in main() I have two pieces of code - the first one needs to start at the beginning of main and it is very small the second one will be placed just after at the beginnig adddress + 200h can you tell me the directive(s) to use to set this second piece of code to be placed at this specific address after the beginning of main()
The traditional way to do this is to define a section and use a #pragma to put the code into that section, typically on a function-by-function basis. The Keil IDE has a simple way of doing this for all code in a single file: right-click on your file and use the drop-down boxes to force code data into a segment your define in the target options.
From your question it sounds like you want code within your main() to be at specific addresses. I'm not sure how easy that is without resorting to inline-assembly.
Here's a little more detail from the ARM website on the general topic. infocenter.arm.com/.../BABDJCAA.html
Andrew
thanks for the quick reply
Im building a bootloader and want to make it jump to application after power up always
but...I need to have a predefined jump address where the application code will force a jump to and start the actual bootload operation that resides in the bootloader: get data over usart and write to flash until done when a sw reset will re-start the micro
Im thinking this jump address needs to be in main() (after the jump to application always) but does not need necessarily the case
your help is much appreciated
You are talking about two separate programs that have a separate load region (check your linker user manual!) - a bootloader and an application. What you describe can be achived by a simple function call! You need to separate the programs - each program can be placed then at will - either using a scatter loading file or directly via the IDE (with limited capabilities). There are some samples on the NXP site.
View all questions in Keil forum