2 Replies Latest reply on Nov 12, 2020 11:28 PM by DheerajK_81

    RTOS

    OmAb_4672891

      Hello guys,

       

      I am trying to add freeRTOS to my MCU's to make my RT system more robust. I have a few questions .

      I noticed after porting the freeRTOS using this tutorial:https://iotexpert.com/psoc4-freertos-port/ oncer

       

      A simple LED blink project with the freeRTOS is at 80.5% SRAM. this is without preflashing the bootloader and then flashing the board.

       

      My questions are:
      1) How full can this SRAM get? Can I get it to 100% safely without any concern?
      2) How does it differ from Flash memory? Is it cumulative?
      3) Should the order of operations be: Flash bootloader (which also contain RTOS) and then remote flash the application?

      or shall I make the RTOS incorporate the bootloader somehow.

       

      Thanks again!

        • 1. Re: RTOS
          GaneshD_41

          Hi,

           

          A simple LED blink project with the freeRTOS is at 80.5% SRAM. this is without preflashing the bootloader and then flashing the board.

          Do you mean that you directly programmed your project without using the concept of Bootloader and Bootloadable?

           

          Answering to few of your questions:

           

          1) How full can this SRAM get? Can I get it to 100% safely without any concern?

          You can use 100% SRAM without any issues. Please ensure that you have enough stack and Heap space for your application. Otherwise the Stack overflow error occurs even if you have the enough RAM. You can change stack and heap memory in system tab of the .cydwr window in PSoC Creator project.

           

          2) How does it differ from Flash memory? Is it cumulative?

          SRAM is the volatile memory where the variables of your application would reside. (except constant variables). Where as Flash memory is the nonvolatile memory where your code resides. Both are not cumulative.

           

          3) Should the order of operations be: Flash bootloader (which also contain RTOS) and then remote flash the application?

          or shall I make the RTOS incorporate the bootloader somehow.

          I could not understand the sentence "shall I make the RTOS incorporate the bootloader somehow".

          If you are using Cypress' Bootloader and Bootloadable components, we would recommend that your application has freertos in it but not the Bootloader. Since the Bootloader project just loads the application into flash as single task, there is no need for incorporating freeRTOS in Bootloader. Is this answer your question?

           

          Please update if you have more questions.

          Thanks

          Ganesh

          • 2. Re: RTOS
            DheerajK_81

            Hello,

             

            PSoC4200 comes with 32KB SRAM and upto 256KB of Flash memory. The FreeRTOS kernel should take about 5-10KB of flash memory and when it comes to RAM, the scheduler takes up about 250-300 bytes and each task about 64 bytes plus the task stack size.

             

            Since you have not mentioned which device you are using, I'm not sure what 80% equates to here. In case it is the PSoC4200 device used in the blog, then it should be around 13KB (see project attached) for a simple blinky project i.e 40% of total SRAM and Flash usage is just around 8K (3.2%).

             

            You can always look at the .map file to determine what's taking up space. In the attached project, please change the build settings to add the include directories of your FreeRTOS source files. Also, add the .c and .h files as mentioned in the blog.

             

            I used FreeRTOSv10.4.1 for the testing.  Hope this helps!

             

            Regards,

            Dheeraj