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

memory mapping and linker file for C164CI

I use a DIP module with an C164 CI.
When I want to add some code and some variables in my excisting program, it does not work anymore. It must be due to the memory mapping and the linker file which are not right configured.

here is the linker: (in monitor mode)

 
SECTIONS(?C_STARTUP_CODE%ICODE (0x01000), ?C_INITSEC (0x01150))

CLASSES(ICODE (0x000200-0x003FFF) , FCODE (0x000200-0x003FFF),
NCONST (0x000200-0x003FFF) , FCONST (0x000200-0x003FFF),
NDATA (0x060000-0x061FFF) , NDATA0 (0x060000-0x061FFF),
FDATA (0x060000-0x061FFF) , FDATA0 (0x060000-0x061FFF), 
HDATA (0x060000-0x061FFF) , HDATA0 (0x060000-0x061FFF),
XDATA (0x060000-0x061FFF) , XDATA0 (0x060000-0x061FFF))

RESERVE(0x04-0x0B,0x0AC-0x0AF,0x0B8-0x0BB,0x6b00-0x7fff,0xE000-0xF9FF,0x3E900-0x3FFFF)


As option in Keil I use:

memory model :Large
no use of on chip ROM
use of on chip RAM

external memory:
RAM 0x40000-0x46AFF
ROM 0x200000-0x23FFFF


Do anyone have the right option that I have to choose to make my program work whatever the code's size is? in monitor mode or in flash mode?

thank you.

Parents
  • You need to have two separate projects; one for UV debugging in RAM and another for the final output. They have all the same files but the memory maps, compiler flags, defines and linker settings can be different between them. Once you get the debugging one working, create a new target (check the copy project settings checkbox). Now you can change the external target memory in the target tab and check the memory map in the linker/locater tab. You will notice that the settings you gave show all the Data and Code in locations that don't have any memory.

    I've found that creating a formal memory layout on paper for the project with locations shown for all related projects is very helpful. I use it for sorting out the chip memory layouts ('167 vs. '168...) and project layouts (UV debugging, programming updates, running, ...). If you write me I can send you a word version of one.
    scott.dewolski@the-spa.com
    Best luck

Reply
  • You need to have two separate projects; one for UV debugging in RAM and another for the final output. They have all the same files but the memory maps, compiler flags, defines and linker settings can be different between them. Once you get the debugging one working, create a new target (check the copy project settings checkbox). Now you can change the external target memory in the target tab and check the memory map in the linker/locater tab. You will notice that the settings you gave show all the Data and Code in locations that don't have any memory.

    I've found that creating a formal memory layout on paper for the project with locations shown for all related projects is very helpful. I use it for sorting out the chip memory layouts ('167 vs. '168...) and project layouts (UV debugging, programming updates, running, ...). If you write me I can send you a word version of one.
    scott.dewolski@the-spa.com
    Best luck

Children