I’m using the folowing memory map: Main Flash: 0x0000 ~0xffff – Pag 0 Second Flash: 0x0000 ~0x1fff SRAM: 0xE000 ~0xffff If I’m running my IAP programming in the second Flash, can I accesses the main Flash and SRAM or I will have conflict problems ? I’m asking this because de SRAM is in the same adress of the main flash (0xE000 ~0xffff ). thanks
Posted on May 17, 2011 at 11:59 Hi Sombra, From the secondary flash, you cannot program any part of the main flash shadowed by the SRAM, the CSIOP, or the secondary flash itself. The trick, to circumvent this problem, is to flip the main flash pages. You didn't write which chip you are using, I assume it is one with 32K flashes (the situation is not much different with 16K flashes). 1 - Set all the non-primary flashes (secondary, SRAM and CSIOP) below 8000. 2 - Define page 0 with FS0 at 0-7FFF and FS1 at 8000-FFFF (normal running mode) 3 - Define page 1 with FS0 at 8000-FFFF and FS1 at 0-7FFF (for IAP only) Now you can program FS0 in page 1 and FS1 in page 0: they are both above 8000. It works for me. Good luck, Daniel
Thanks for your help, but I didn’t understand how to implement the item 2 – 3. Using the PSDsoft Express I can configure FS0 at 0-7FFF and FS1 at 8000-FFFF but how can I change it to be FS0 at 8000-FFFF and FS1 at 0-7FFF in execution time ? Is it possible ? Thanks Saul
Detailing steps 2 and 3: In PSDSOFT, at the ''Define PSD Pin/ Node Functions'' main menu you define the functions of all the pins, then, at the next sub-menu ''Page Register Definition'', you select one pgr bit for paging: click the paging mark of pgr0. The next sub-menu is ''Chip Select Equations''. Click FS0 there: you get 3 lines. At the first line, set ''Page Number'' to 0, ''Hex Start Address'' to 0 and ''Hex End Address'' to 7FFF. At the second line, set ''Page Number'' to 1, ''Hex Start Address'' to 8000 and ''Hex End Address'' to FFFF. Leave the third line blank. Click now FS1, and repeat this operation, inverting the page numbers. You are done with PSDSOFT. At run time, you control the main flash page (from the secondary flash) using the ''Page'' register (CSIOP address = E0). I hope that this helps, Daniel