Jump to content
43oh

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

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

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...