cancel
Showing results for 
Search instead for 
Did you mean: 

Hard fault in X_CUBE_CRYPTOLIB, how to proceed?

LWChris
Associate III

Our STM32WB55 user application is currently in the HardFault_Handler. (Full disclosure: I am not an embedded developer at all, I have never debugged such a problem, so I'm not really knowing what I am doing. I need precise, detailed step-by-step instructions in the form of "Click here, type this, copy that part" etc.)

I have been trying to find out what the problem is using this article:

CFSR is 0x8200 (PRECISERR, BFARVALID)

BFAR is 0x20040000


_legacyfs_online_stmicro_images_0693W00000dK209QAC.png 

However, I am stuck at trying to display the stack frame. All of the "svd" commands to debug further along that article are unknown to the "Debugger Console" tab in the STM32CubeIDE, and the "p/a *frame" command says there's no symbol "frame" in current context.

The stack trace indicates it's a problem from within the X_CUBE_CRYPTOLIB, when calling in "cmox_rsa_pkcs1v15_encrypt", the exception occurs in cmox_bn_cCopy. This method has been called thousands of times and never failed, so I don't know what's wrong.


_legacyfs_online_stmicro_images_0693W00000dK1RyQAK.pngThe best I could do is inspect my code and make sure that all variables to "cmox_rsa_pkcs1v15_encrypt" are set properly, which they are. Since I don't have the symbols for the X_CUBE_CRYPTOLIB, I could only view the disassembly:


_legacyfs_online_stmicro_images_0693W00000dK23IQAS.png 

The MCU is still in this state, but as I said, this error occurred once now after using that part of the code thousands of times, so I really don't want to reset the MCU unless I know nothing more needs to be looked at. If I can extract more info and you can tell me which commands to run in order to get them, I'll be happy to help.

0 REPLIES 0