FreeRTOS, LWIP, MEBDTLS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FreeRTOS, LWIP, MEBDTLS

Jump to solution
1,964 Views
a8Chcx
Contributor V

Hi,

I am using MCUXpreeso 11.5.0 with SDK2.11.0 for FRDM-K66 testing.

I import demo project for HTTPS MBedTLS based server and it works fine...

Then, I created the new project with RTOS, LWIP, MBedTLS and etc...

1) I tested the new project with HELLO world by using RTOS and works fine...

2) I copy all required files from the above sample project and compile the project properly.

When I tried to run and got the following error: "Function called without core lock".

Then I compare the difference between sample and my project, found that sample project is using heap3.c and my project is using heap4.c. Then I delete heap4.c, got the compile error.

Can anybody tell me how to fix the problem? Change heapx.c will fix the problem? and how to switch to heap3.c?

Thanks,

Christie

 

0 Kudos
Reply
1 Solution
1,901 Views
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

Hello Christie

Please take a look to this website, here you will find information about the different memory implementations that FreeRTOS has.

https://www.freertos.org/a00111.html

As you can see, there are 5 different heap implementations. Usually MCUXpresso uses heap 4 when creating a new project.

If you need to switch to another implementation, I found a way to do that.

  • First, make sure that the macro configFRTOS_MEMORY_SCHEME is enabled with the number 3
  • Find and open the .cproject file on your project folder using a text editor
  • Search for the word “excluding“
  • You will have two matches, and will appear something like this <entry excluding="freertos_kernel/portable/MemMang…
  • In those two lines change where it says “heap_3.c” to “heap_4.c”

DanielRuvalcaba_1-1649796482855.png

DanielRuvalcaba_2-1649796482860.png

 

 

 

 

Can you please try this on your code?

If you still having problems, check out the links I’m dropping you down below. There is more information about the heap usage.

https://www.nxp.com/docs/en/quick-reference-guide/MCUXpresso_IDE_FreeRTOS_Debug_Guide.pdf

https://mcuoneclipse.com/2017/09/18/using-multiple-memory-regions-with-the-freertos-heap/

https://mcuoneclipse.com/2020/11/15/steps-to-use-freertos-with-newlib-reentrant-memory-allocation/

I hope this helps, Daniel.

View solution in original post

0 Kudos
Reply
4 Replies
1,941 Views
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

Hello Christie

I have a few things to say about your problem.

First of all, could you please tell me how exactly you copied the files you just mentioned?

Could you also give me more information about the type of application you want to implement to see if we can help you with that?

Finally, could you please take a look on some of the SDK examples? Because of what you’re saying, the example lwip_httpssrv_mbedTLS_freertos sounds very similar of what you are trying to do.

Best Regards, Daniel.

0 Kudos
Reply
1,937 Views
a8Chcx
Contributor V

HI Daniel,

If I am using demo project " lwip_httpssrv_mbedTLS_freertos" and it works fine on IDE11.2.0 and 11.5.0.

Then, I generated the new project including RTOS, IWIP, MbeTLS and etc...Then copy the required files from demo.

For IDE11.2.0, it works fine.

For IDE11.5.0, it stop working.

After I checked the difference, I found RTOS is using heap4.c instead of heap3.c in IDE11.5.0.

Looks like, heap4.c does not work properly with MbedTLS...

Thanks,

Christie

0 Kudos
Reply
1,902 Views
DanielRuvalcaba
NXP TechSupport
NXP TechSupport

Hello Christie

Please take a look to this website, here you will find information about the different memory implementations that FreeRTOS has.

https://www.freertos.org/a00111.html

As you can see, there are 5 different heap implementations. Usually MCUXpresso uses heap 4 when creating a new project.

If you need to switch to another implementation, I found a way to do that.

  • First, make sure that the macro configFRTOS_MEMORY_SCHEME is enabled with the number 3
  • Find and open the .cproject file on your project folder using a text editor
  • Search for the word “excluding“
  • You will have two matches, and will appear something like this <entry excluding="freertos_kernel/portable/MemMang…
  • In those two lines change where it says “heap_3.c” to “heap_4.c”

DanielRuvalcaba_1-1649796482855.png

DanielRuvalcaba_2-1649796482860.png

 

 

 

 

Can you please try this on your code?

If you still having problems, check out the links I’m dropping you down below. There is more information about the heap usage.

https://www.nxp.com/docs/en/quick-reference-guide/MCUXpresso_IDE_FreeRTOS_Debug_Guide.pdf

https://mcuoneclipse.com/2017/09/18/using-multiple-memory-regions-with-the-freertos-heap/

https://mcuoneclipse.com/2020/11/15/steps-to-use-freertos-with-newlib-reentrant-memory-allocation/

I hope this helps, Daniel.

0 Kudos
Reply
1,949 Views
a8Chcx
Contributor V

Looks like that this IDE generate the RTOS project with heap4.c as default. And heap4.c is not working with MbedTLS...

Can anyone to confirm this for me?

Any how to switch back to heap3.c because I tried delete and copy, it not working...

 

Thanks,

Christie

0 Kudos
Reply