Skip to main content
Visitor II
January 8, 2005
Question

main flash for code and data

  • January 8, 2005
  • 4 replies
  • 1222 views
Posted on January 08, 2005 at 13:34

main flash for code and data

    This topic has been closed for replies.

    4 replies

    jones2Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 12:05

    Hello,

    I use the uPSD3234a.

    I have a problem with the page memory configuration.

    I used to have all my code on the boot flash.

    and use page 0 and 1 for data.

    now since my code got larger, I set page 0 and 1

    to contain some of my code. The program runs good.

    however the method I used before for writing parameter

    to a page doesn't work any more.

    I think it is because now both flashs are set to ''Program Space Only'' (the pogram does not run in any other way)

    in the PSDsoft Express.

    here is how I used it before:

    here are the access addreses codes:

    PSD8xx_reg.PAGE = 0x02;// flash sector 0 selected

    FLASH_COM_X555 = (uchar xdata *)(FLASH_PARAM_ADDR + 0x0555);

    FLASH_COM_XAAA = (uchar xdata *)(FLASH_PARAM_ADDR + 0x0AAA);

    FLASH_COM_X000 = (uchar xdata *)(FLASH_PARAM_ADDR);

    then for example erase sector code

    *(FLASH_COM_X555) = 0xAA; // unlock main flash, write 0xAA to addess 0xX555

    *(FLASH_COM_XAAA) = 0x55; // unlock main flash, write 0x55 to addess 0xXAAA

    *(FLASH_COM_X555) = 0x80; // write 0x80 command to erase entire chip

    *(FLASH_COM_X555) = 0xAA; // continue unlock sequence

    *(FLASH_COM_XAAA) = 0x55; // continue unlock sequence

    *(FLASH_COM_X000) = 0x30; // write 0x30 command to erase 1 sector

    should I use the PAGE register differently?

    or should I use a different type now for the address instead of ''xdata''?

    Thank you.

    jones2Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 12:05

    Hi,

    I corrected this problem by setting the PSDSoft to

    ''Program and Data Space'' for main

    flash programing of a page is possible and storing code

    on other pages.

    my question is if there is a way to define a pointer to

    a specific page, so by accessing the pointer the page register

    will change automatcaly?

    I tried enabling in uVision2 the far type, but all the banking configuration has reseted, and the extended linker

    has errors.

    I don't think there is another way, maybe pdata.

    [ This message was edited by: std on 29-12-2004 13:05 ]

    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 12:05

    Hey,

    I was searching ST's site for a multi-paging demo and I couldn't find one for the dk3200. BUT I did find one for the dk3300, which is almost identical to the 3200. This demo provides seemless page-to-page function calls and more.

    dk3200 & dk3300 demo's are here:

    http://www.st.com/stonline/products/families/memories/psm/soft_c2.htm

    The banking demo is called: dk33dsn4 (i think).

    This is pretty much a hello world app, but it uses all 8 pages. Simply make the necessary mods to run this on the dk3200 instead.

    Hope I could help.

    jones2Author
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 12:05

    HCONST can be mapped to the banked area.

    but HDATA ca not!! so how can I write to main flash without specifying

    the page value first????