printf causing hard fault in NewLibNano(semihost)

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

printf causing hard fault in NewLibNano(semihost)

1,515件の閲覧回数
leo838
Contributor II

Hello All,

I recently tried running demo programs (provided in an LPC812 SDK) in debug mode on a LPC812 Xpresso board (eg. lpcxpresso812max_sctimer_16bit_counter ) & because of memory space constraints was forced to compile it with the Newlibano(semihost) library. This resulted during running in a hard fault (redirection to  function void HardFault_Handler(void)). Once the printf's were committed out the program executed normally.

Am I doing something wrong? From what I've read printf's should be supported in this library./ environment.

Thanks,

Leo

ラベル(1)
0 件の賞賛
返信
2 返答(返信)

1,343件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi leo838 

I don't have exact LPC812 board in my hand, so I tested it with LPCXpresso824 demo board.

If you want to print to uart, I suggest you use Newlibano nohost. although I tested semihost lib also working, but using Newlibano nohost is my recommendation.

Please see my attached video, there is no hardfault while running the program. I suggest you follow the steps and test yours.

Have a great day,
Jun Zhang

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 件の賞賛
返信

1,343件の閲覧回数
leo838
Contributor II

Jun,

Thanks for the reply.

I was under the impression that a semihost library was required to enable printf messages to be sent to the debug console. I tried your solution but unfortunately the same result. I then tried using the following:

quick setting> SDK debug console> semihost console

& together with the nohost library it solved the issue.

It seems, at least in my environment, that these settings are not retained during builds.

Thanks for your help

0 件の賞賛
返信