Version number in bootloader

I’d like to incorporate a version number in the bootloader, which is then accessed from the main program (primarily so I can keep the two parts of the program in sync).

Has anyone got any suggestions as to the simplest way to do this?

I’d setup a define in the boot loader (probably blmain.c in src/bsp/customize/), and during NABlMain write it to an unused register (see the processor HRM associated with your device). When you application starts up, read this register and now you have the boot loader code.

Thanks for the tip - I’ll give that a try

Passing a pointer in a register looked a bit tricky - needed mods to core code, rather than that intended for customisation.

But I found the 1K block of initdata, which on some platforms passes the initial values of the I/O ports.

If I modify customizeButtons.c to put a string into a known location in that data block, its accessible from the main program.

Hi,

This looks like a good solution. Apart from the data that is set up in customizeButtons.c did you find any defition on what other data is placed in this buffer?

I have had a quick search through the code and cannot see any other references to it. There does not appear to be any description of it in the API help files.

Hi,

This looks like a good solution. Apart from the data that is set up in customizeButtons.c did you find any defition on what other data is placed in this buffer?

I have had a quick search through the code and cannot see any other references to it. There does not appear to be any description of it in the API help files.

Like you, I could find no documentation - just a cryptic note in customize.ldr which put me on the right track.

As far as I found, only customizeButtons.c writes to this area - some of the data I read in the main program suggests that its never initialised.

The connectcore 9P customizeButtons.c sets up the first 16 bytes with the initial I/O port values; the ME/ME9210 routines appear not to use this area. I didn’t look at any others.

I put my string at an offset of 32 bytes just to give some contingency - not a problem since the default size of this area is 1K

HI,

Many thanks, That is about all that I found as well