cancel
Showing results for 
Search instead for 
Did you mean: 

SBSFU with embOS (user app)

THugo
Associate II

Hi everyone,

I have a problem about the integration of the SEGGER embOS RTOS with SBSFU.

I have already succeeded with FreeRTOS but I would like to use embOS for my project. The "SECoreBin" project compiles well, I added the instruction to deactivate the systick in the SBSFU project just after "SFU_LL_SB_SRAM_Erase ();".

When I run my "user app" project my interrupt "systick_handle" does not work.

Have you ever used embOS with SBSFU ? Do you have any advice ?

I've been struggling with this problem for several days now :(

Best regards, Hugo

1 ACCEPTED SOLUTION

Accepted Solutions
Jocelyn RICARD
ST Employee

Hello Hugo,

The systick is setup in 2 steps:

1) in HAL_Init

2) in system clock configuration after you changed the clocking

But your issue could be related to something else: did you change the interrupt vector offset in your application to fit the address of your vector table?

It is done in system_stm32*.c where you should have a line like:

#define VECT_TAB_OFFSET 0x00

SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET;

or reusing the application example:

#if defined(__ICCARM__)||defined(__GNUC__)

extern uint32_t __ICFEDIT_intvec_start__;

#define INTVECT_START ((uint32_t)& __ICFEDIT_intvec_start__)

#elif defined(__CC_ARM)

extern uint32_t Image$$vector_start$$Base;

#define INTVECT_START ((uint32_t)& Image$$vector_start$$Base)

#endif

 SCB->VTOR = INTVECT_START;

With SBSFU, your application is not running from flash base address.

You need to change the offset value with the base address offset of your application.

If this is not done, this explains you don't get the interrupt.

Best regards

Jocelyn

View solution in original post

4 REPLIES 4
Jocelyn RICARD
ST Employee

Hello Hugo,

I don't have experience with this embOS so I cannot give you straight answer;

Now, the systick interrupt should trigger if it is activated.

I would suggest checking first your application running without SBSFU and record the systick configuration content (SysTick->LOAD and SysTick->CTRL) as well as interrupt priority and activation settings (NVIC)

Then in SBSFU context, compare the configuration. This will probably give you a clue to find the problem.

Best regards

Jocelyn

THugo
Associate II

Hi Jocelyn,

Thank you for the webseminar just now.

I looked for the value "SysTick-> LOAD and SysTick-> CTRL".

At the start of the "user code", without SBSFU I have this:

SysTick->CTRL = 0

SysTick->LOAD = 0

With the SBSFU code, I have this for SysTick-> CTRL = 0x00000002.

The value is not equal to 0 as for the project without SBSFU.

But when I execute the instruction "HAL_Init ();" in "user code with SBSFU" the value goes to 0x00000007 as for the project without SBSFU.

"HAL_Init();" is my first function called in the "user code".

Unfortunately it still does not work.

My "SysTick_Handler" is not running :( therefore the call to the "HAL_Delay" function does not work.

Jocelyn RICARD
ST Employee

Hello Hugo,

The systick is setup in 2 steps:

1) in HAL_Init

2) in system clock configuration after you changed the clocking

But your issue could be related to something else: did you change the interrupt vector offset in your application to fit the address of your vector table?

It is done in system_stm32*.c where you should have a line like:

#define VECT_TAB_OFFSET 0x00

SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET;

or reusing the application example:

#if defined(__ICCARM__)||defined(__GNUC__)

extern uint32_t __ICFEDIT_intvec_start__;

#define INTVECT_START ((uint32_t)& __ICFEDIT_intvec_start__)

#elif defined(__CC_ARM)

extern uint32_t Image$$vector_start$$Base;

#define INTVECT_START ((uint32_t)& Image$$vector_start$$Base)

#endif

 SCB->VTOR = INTVECT_START;

With SBSFU, your application is not running from flash base address.

You need to change the offset value with the base address offset of your application.

If this is not done, this explains you don't get the interrupt.

Best regards

Jocelyn

THugo
Associate II

Hi Jocelyn,

Ok, it work's. Indeed it was an issue with "SCB-> VTOR".

I used the file "system_stm32l4xx.c" by default which is in the folder "CMSIS\Device\ST\STM32L4xx\Source\Templates".

You must therefore modify this file with the instructions above.

Thank you for your help.

Best regards, Hugo