Jump to content
asantos

Not able to invoque BSL from software with Energia

Recommended Posts

Hi,

I am trying to invoque the BSL with the following code :

#define BSL_PARAM 0xFC48FFFF // I2C slave address = 0x48, Interface selection = Auto
#define BSL_API_TABLE_ADDR 0x00202000 // Address of BSL API table
#define BSL_ENTRY_FUNCTION (*((uint32_t *)BSL_API_TABLE_ADDR))
((void (*)())BSL_ENTRY_FUNCTION)((uint32_t)BSL_PARAM); // Call the BSL with given BSL parameters

It compiles fine when I use this code inside a C project (like the uartecho exaple) 

However, when I use it inside a Energia project in CSS, I get the error "Too many arguments to function" on this line

((void (*)())BSL_ENTRY_FUNCTION)((uint32_t)BSL_PARAM); // Call the BSL with given BSL parameters

It's probably something stupid but I cannot find out what the issue is
See compiler project properties for both projects:

image.png.03bcf29ff833c6bcbeaf80fff728487e.png

image.png.8cad499e509219599d3e87b22f305ea5.png

 

Has anyone tried doing this with Energia?

I posted on the TI support forum and I was told to ask it here.

 

Thanks

Share this post


Link to post
Share on other sites

Your main Sketch tab should look like:

extern "C" void foo();

void setup() {
  bsl();
}

void loop() {
}

Then create another tab called bsl.c and add the following content to it:

#include <stdint.h>

#define BSL_PARAM 0xFC48FFFF // I2C slave address = 0x48, Interface selection = Auto
#define BSL_API_TABLE_ADDR 0x00202000 // Address of BSL API table
#define BSL_ENTRY_FUNCTION (*((uint32_t *)BSL_API_TABLE_ADDR))


void foo() {
  ((void (*)())BSL_ENTRY_FUNCTION)((uint32_t)BSL_PARAM); // Call the BSL with given BSL parameters
}

This compiles but I have never used the BSL function in Energia.

Robert

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×