2015-01-24 02:33 AM
Hi,
I used the CubeMX framework to implement a USB mass storage device for my STM32L1 device.I see that the code is issuing a hard fault when the laptop connected to the device is reading sectors from the device during the enumeration process.The ''Fault Reports'' window in my uVision debugger indicates a INVPC userfault, which I am guessing is the cause for the hard fault.I tried to figure out the instruction causing the fault by following instructions in the related app note at http://www.keil.com/appnotes/files/apnt209.pdf. When I break execution in the HardFault exception handler, I see that value of LR is 0xffffffff, which means I need to retrieve the context for the exception causing code from the PSP. However, the value of PSP is 0. Can somebody explain why this may the case?How can I then retrieve the address of the instruction causing the fault?Also, are there any known issues with the Cube USB MSC code?Thanks,Ben2015-11-26 09:35 AM
Dear user,
You need to adjust the heap of your project (0x400). Best regards2015-11-26 09:53 AM
I'd double check both the heap and stack sizes defined in the startup.s are adequate.
Note the thread was started 11 months ago.