- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am looking for an example of passing a variable from the Bootloader component to the Bootloadable application on a PSoC 4200M. Even a single 16-bit value is sufficient.
Basically, I need a piece of uninitialized RAM shared between the two pieces of code.
Thanks,
Bill
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This solution is confirmed only in GCC tool-chain.
There is a RAM section named ".btldr_run" declared in the linker script cm0gcc.ld as follows.
.btldr_run (NOLOAD) : ALIGN(8)
{
KEEP(*(.bootloaderruntype))
}
Originally, this section is used to pass the RUN-TYPE parameter to the Bootloadable by the Bootloader. This section seems to be used by user.
To use the section, declare your own variable specifying the section name.
volatile uint8 bootParams[16] CY_SECTION(".bootloaderruntype");
Please note that this declaration is required both bootloader and bootloadable.
.btldr_run 0x200000c0 0x14
*(.bootloaderruntype)
.bootloaderruntype
0x200000c0 0x10 .\CortexM0\ARM_GCC_541\Debug\main.o
0x200000c0 bootParams
.bootloaderruntype
0x200000d0 0x4 .\CortexM0\ARM_GCC_541\Debug\Cm0Start.o
0x200000d0 cyBtldrRunType
It was found in the MAP file that the variable is located in the specified section. In my case, the user-defined variable is located before the variable CyBtldrRunType. The order of these variables are specified by the object file linking order. If you want to ensure the variable order, you must modify the system-provided linker file.
I added an example project.
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This solution is confirmed only in GCC tool-chain.
There is a RAM section named ".btldr_run" declared in the linker script cm0gcc.ld as follows.
.btldr_run (NOLOAD) : ALIGN(8)
{
KEEP(*(.bootloaderruntype))
}
Originally, this section is used to pass the RUN-TYPE parameter to the Bootloadable by the Bootloader. This section seems to be used by user.
To use the section, declare your own variable specifying the section name.
volatile uint8 bootParams[16] CY_SECTION(".bootloaderruntype");
Please note that this declaration is required both bootloader and bootloadable.
.btldr_run 0x200000c0 0x14
*(.bootloaderruntype)
.bootloaderruntype
0x200000c0 0x10 .\CortexM0\ARM_GCC_541\Debug\main.o
0x200000c0 bootParams
.bootloaderruntype
0x200000d0 0x4 .\CortexM0\ARM_GCC_541\Debug\Cm0Start.o
0x200000d0 cyBtldrRunType
It was found in the MAP file that the variable is located in the specified section. In my case, the user-defined variable is located before the variable CyBtldrRunType. The order of these variables are specified by the object file linking order. If you want to ensure the variable order, you must modify the system-provided linker file.
I added an example project.
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This looks excellent! Thank you. I will test it with my app.
Update: I implemented this and it worked perfectly.
Thanks again,
Bill