Skip to main content
zeke.huang
Associate II
June 20, 2019
Solved

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

  • June 20, 2019
  • 4 replies
  • 2054 views

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.

    This topic has been closed for replies.
    Best answer by zambrano.luigi

    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

    4 replies

    zambrano.luigi
    ST Employee
    June 21, 2019

    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

    zeke.huang
    Associate II
    June 24, 2019

    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
    ST Employee
    June 24, 2019

    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

    zeke.huang
    Associate II
    June 24, 2019

    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
    zambrano.luigiBest answer
    ST Employee
    June 24, 2019

    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

    zeke.huang
    Associate II
    June 24, 2019

    Hi Luigi,

    Under your suggestion, the problem is solved.

    thanks your very much.

    keeping touch each other.

    Best Regards,

    zeke

    zambrano.luigi
    ST Employee
    June 24, 2019

    Hi Zeke,

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

    Best Regards,

    Luigi