This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2540 Enter UBL through software

Other Parts Discussed in Thread: CC2540

I'd like to be able to enter the UBL through a software command without the need for a button press on startup.  I've searched around and haven't found any info regarding this yet.  Is this something that is possible with a CC2540?

  • It should be possible. You could use a flash bye or a non-initialized RAM byte to decide whether to enter the UBL on startup. You could then edit this byte and reset the device in your command.

  • Thanks for the response.  It looks like to do it that way I'll need to read a byte of memory in ublExec(void).  I'd like to be able to write a byte using osal_snv_write in my application (already working) and then simply read back that byte with HalFlashRead.  The only problem now is how do I convert the snv ID to a real memory address?

  • Got it working finally. Ended up adding a version of osal_snv (minus all the write commands to save space) to a duplicate UBL project. From there I modified the ublExec and ublInit functions so that it inits osal_snv and reads the ID that I write to in my application. It also leaves the timer intact so if a user wants to exit the bootloader without loading a new bin, they simply need to wait the appropriate period of time and it will jump to the current application. Since I removed the writing from osal_snv for the bootloader, the application needs to reset the bootloader flag on launch or it would always launch to the bootloader after an initial set.