cancel
Showing results for 
Search instead for 
Did you mean: 

MCU can not run after added FreeRtos component in DSPI test Application.

zeke.huang
Associate III

Hi, ST experts

I added component 'SPC5 FreeRTOS Component RLA' to the applicaion of ‘SPC560BCxx_RLA DSPI Test Application’.

Found that MCU can not run, the attachment is the source code, experts help to see, what is the problem?

I tried to solve this problem many days and failed.

Thank you very much.

Detail of the attachment information:​

Board: SPC560BCXX_EVB

Product line: B/C-line

Device: SPC560B50L1

Applicaiton name: SPC560BCxx_RLA DSPI Test Application.

1 ACCEPTED SOLUTION

Accepted Solutions
zambrano.luigi
Senior III

Hi Zeke,

you have to be sure that the exchange function is completed before the schedule will run another task. So, probably, it is better to add a delay after the spi_lld_exchange (osalThreadDelayMilliseconds) before the run the schedule.

Best Regards,

Luigi

View solution in original post

7 REPLIES 7
zambrano.luigi
Senior III

Hi,

if you add the FreeRTOS component, your application must be base on FreeRTOS tasks. So, within your main you have to create the tasks (by using the function xTaskCreate) and run the OS schedule (by using the function vTaskStartScheduler). Please, refer to the test application "SPC560BCxx_RLA DSPI Test Application" included in SPC5Studio that show you how to use FreeRTOS on Bolero BC board.

Best regards,

Luigi

Hi, Luigi

Thank you for your reply.

According to your suggestion, the program will die in the first place where the SPI exchanges data, and will not go down to the Task.

  ....

  Spi_lld_exchange(&SPID1, 4, txbuf, rxbuf);

  ....

In fact, we have also done this experiment.

Is there a better suggest?

zambrano.luigi
Senior III

Hi,

in attachment you can find an example that show you how to use the exchange API within a FreeRTOS task. I have verified that this example works fine on my SPC560BC minimodule + motherboard.

Please, feel free to contact me for any clarification.

Best Regards,

Luigi

Hi, Luigi

​Thank your very much.

The example you gave me can run normally.

I have a question, Can the function run here? As shown below:

0690X000008j5mGQAQ.png

zambrano.luigi
Senior III

Hi Zeke,

you have to be sure that the exchange function is completed before the schedule will run another task. So, probably, it is better to add a delay after the spi_lld_exchange (osalThreadDelayMilliseconds) before the run the schedule.

Best Regards,

Luigi

Hi Luigi,

Under your suggestion, the problem is solved.

thanks your very much.

keeping touch each other.

Best Regards,

zeke

zambrano.luigi
Senior III

Hi Zeke,

good news. You are welcome. Please, feel free to contact me.

Best Regards,

Luigi