This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

External Flash

Hi,
Currently I'm using LPC2478 that has 512KB Internal flash with my ULINK2.
It works fine - I can downlaod flash, Debug, Run....

512KB become too small - I would like to move to bigger flash size (without changing NXP).

I Can use the LPC2470 (without internal flash) and connect it to the SST39x160x (that is supported by the ULINK2).
When I do that- I will loose something?
Can I still download , Debug, and run the target with the JTAG and ULINK2?

Regards,
Doron

  • 512KB become too small - I would like to move to bigger flash size

    Hmm... It would be a good idea to stop for a minute and think about why you are running out of memory. If you have a lot of data in ROM (like content for a web server) it should be easy to offload the data into an external serial flash memory device. If you actually have 512 KB of code, maybe the structure of your program is far from optimal?

    Can I still download , Debug, and run the target with the JTAG and ULINK2?

    Not sure if uVision can burn an internal flash out of the box, but running and debugging the code should present no problems.

  • Correction: Not sure if uVision can burn an external flash out of the box

  • Can I still download , Debug, and run the target with the JTAG and ULINK2?

    You need to adjust the initialization file (debug page of project settings) of uv4 so that it can access the NOR flash (LPC2478):

    // Setup pins for External NOR Flash
    _WDWORD(0xFFE08000, 0x00000001);        // EMC_CTRL: Disable address mirror
    _WDWORD(0xE01FC0C4, _RDWORD(0xE01FC0C4) | 0x00000800);    // PCONP: Turn on EMC PCLK
    _WDWORD(0xE002C018, 0x55555555);        // PINSEL6
    _WDWORD(0xE002C020, 0x55555555);        // PINSEL8
    _WDWORD(0xE002C024, 0x10051555);        // PINSEL9
    
    // Setup controller for External NOR Flash
    _WDWORD(0xFFE08200, 0x00000081);        // EMCStaticConfig0
    _WDWORD(0xFFE08204, 0x00000000);        // EMCStaticWaitWen0
    _WDWORD(0xFFE08208, 0x00000003);        // EMCStaticWaitOen0
    _WDWORD(0xFFE0820C, 0x00000005);        // EMCStaticWaitRd0
    _WDWORD(0xFFE08210, 0x00000000);        // EMCStaticWaitPage0
    _WDWORD(0xFFE08214, 0x00000000);        // EMCStaticWaitWr0
    _WDWORD(0xFFE08218, 0x00000000);        // EMCStaticWaitTurn0
    
    
    LOAD .\bin\FMMapp.axf INCREMENTAL     // Download program
    //_WDWORD(0xE01FC040, 0x00000003);        // Remap External Memory to 0
    
    PC = 0                                  // Set PC to beginning
    g, main
    

    You might also consider adjusting your bootloader to accomplish the same via IAP.

  • Hi Mike,
    Thanks for your quick reply.
    I know that it sound to be a very big code size - but : YES , it's a very big project that handle a lot of tasks. This project has a TCP, CAN, TFT (LCD) and a lot of mathematic algorithems.

    So - the question remains ..

    Thanks,
    Doron

  • Hi Tamir,
    Thanks for your reply,
    Is the file that you suggested should be used in the ULINK ( initialization file) and thats it...
    I also belive that the FMMapp.axf shold be replace with my project name...

    Do you have any suggestion for the external NOR flash?

    Thanks,
    Doron

  • Yes - it is that simple.
    Do note that you also need to actually place code in the NOR flash using a scatter loading file.

  • Also note that the file I posted assumes your NOR flash is connected to a specific static bank of your EMC, but that should not be hard to change is necessary!

  • Hi Tamir,
    Now I'm confused:
    The bottom line meens that I can connect NOR flash to the LPC2470 - and only by setting the correct parameters (Scatter , ini files etc...) I can fully run and debug the progarm using my ULINK2 (Jtag interface). So the ULINK2 has full access to the NOR flash to program it and to debug the program (breakpoints) ...
    I'm right?

  • Yes you are right. I've done it myself.