We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I must split code into 2 space in one project, one is boot code, it is ROM, from 0x0000 to 0x8000, the other is application code, it is flash, from 0x8000 to 0xa000. I'm only code flash section in application. How to set KEIL, and make sure the boot code section is all in 0x0000-0x8000 while the flash section is all in 0x8000-0xa000? by the way, I use generic 8032.
Wouldn't it be best to treat this as two entirely separate Projects?
The linker directives (CODE, DATA for BL51; SEGMENTS for LX51) allow you to order and place segments. The RESERVE directive might also come in handy to prevent projects from using some ranges of available memory (or sometimes you can simply not admit to the tools that the high memory range even exists).
For my own project with boot and application code, I do as Andy suggests and simply build two different projects, which have two different memory maps described to the linker.
yes, thanks, I think it is a good idea.
I have another question, how to set stack and data if I split it 2 project? for example, the data space used is from 0x08 to 0x50, at same time, I want to set stack from 0x80 to 0xff, because I want to leaf 0x50-0x80 to appilication code. I can find stack set in project-option-BL51 locate, when I put 0x80 into Stack, there will is a fatal error! *** FATAL ERROR L207:INVALID NAME POS:625 RAMSIZE (256) CODE (0x0000-0x8000) XDATA (0x9fb0-0x9ffff) STACK (0x80)# how to set stack? thanks?
Application Note 180 Multi-Application Programming for 8051 Devices
This Application Note shows the how to create multi-application projects. The techniques shown are useful when you need a boot loader and an user application but may apply also in other situations. The example projects that come with this application note are created with the PK51 Professional Developers Kit Version 8 and the extended LX51 Linker/Locater.
http://www.keil.com/appnotes/docs/apnt_180.asp
Bootloader Example Code This ZIP file contains some example code the shows you for how to create a program with BOOT code in EPROM from 0000h to 7FFFh and an external program in FLASH from 8000h to 0FFFFh. The bootloader and FLASH programming code is not included in this example project.
The project file BOOT.UV2 includes a debugger setup that loads both applications for symbolic testing. http://www.keil.com/download/docs/52.asp