SDK assert results in hardfault

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SDK assert results in hardfault

1,192件の閲覧回数
fruitmans
Contributor II

I am developing a project with the LPC5528 and us the generate SDK code for multiple pheripherals. I created a C++ project and started coding. Since i do not use the heap i set the size of the heap to 0 in my linker configuration. During my development i had great issues when calling the SPI_MasterSetBaud function and it took me a while to figure out what was going on. During the call the MCU jumped to the hard fault handler. The case was an invalid parameter which caused a call somewhere in the assert statement. I think because somewhere in the underlaying code something goes wrong with the allocation of memory due to the heap with size 0. but i do not think it is ok for the SDK code to crash into a hardfault. Can somebody explain to me what i should expect of the assert function defined in the SDK and how i should use it without heap?

0 件の賞賛
返信
1 返信

1,140件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Rik,

If you use MCUXpresso IDE, there is a note in User Guide :

• A value of 0 can be entered to prevent any heap use by an application.
• Note: For semihosted printf to operate without any heap space, you must enable the
“character only” version. For Redlib, define the symbol “CR_PRINTF_CHAR” (at the
project level) and remove other semhosting defines such as CR_INTEGER_PRINTF.
Character only semihosted printf is significantly slower than the default version and may
display differently depending on your debug solution.

0 件の賞賛
返信