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

Using Cypress FX2 external RAM for code larger than 16k

I've scoured through both this site and at cypress to try and find out how to do this, but nothing seems to work. I have program code which is 27k in size, and the internal memory on the FX2 is only 16k; however, the FX2 allows using up to 64k via an external SRAM.

The difficulty I'm having is that when my program size goes over 16k, the Keil monitor stops responding, and my initial startup code that alights an LED never get exectued.

In the Project->Options->User tab of uVision4, I am running the hex2bix program with the -E argument and a memory size of 32k (my EEPROM is larger than that) to be sure. However, I don't think this program should affect the monitor/debugger's ability to run, nor affect my LED lighting code.

My thought was that the address space used by the Keil monitor (I'm using mon-ext-sio1-c0.hex) was being overwritten, but the Keil website says that the monitor uses this address space:

C:E800h — C:FFFFh Monitor ROM

Which I should be nowhere near, given that I'm only using 27k.

It sure seems like there's an option I'm missing or something, but when I comment my code down to 16k, things work well -- as soon as I cross that threshold though, nothing seems to work at all.

Thanks for any help!

Parents
  • There are several things that can go wrong - first, on FX2 XDATA space and code space are unified, so you have to locate your XDATA variables in a way that code can't overwrite it. Linker can't check that overlap as it assumes separate address spaces.

    You must set project settings in a way that assures no overlap. If your code ends at, say 0x9ACA you must specify starting address of XDATA space at 0xA000 (so you will leave some room for code to grow).

    If you are running on dev. board hardware is setup correctly - if you are running on your own, check how your external memory is wired (see chapter 5.5 in TRM).

    Also, you must assure that your descriptors are located in internal memory - otherwise framework will re-locate them to address 0x80, but that can overwrite your code, if your settings are not correct - maybe that's the cause of your problems...

    - Dejan

Reply
  • There are several things that can go wrong - first, on FX2 XDATA space and code space are unified, so you have to locate your XDATA variables in a way that code can't overwrite it. Linker can't check that overlap as it assumes separate address spaces.

    You must set project settings in a way that assures no overlap. If your code ends at, say 0x9ACA you must specify starting address of XDATA space at 0xA000 (so you will leave some room for code to grow).

    If you are running on dev. board hardware is setup correctly - if you are running on your own, check how your external memory is wired (see chapter 5.5 in TRM).

    Also, you must assure that your descriptors are located in internal memory - otherwise framework will re-locate them to address 0x80, but that can overwrite your code, if your settings are not correct - maybe that's the cause of your problems...

    - Dejan

Children