cancel
Showing results for 
Search instead for 
Did you mean: 

Hard Fault during tx_sempahore_get()

YamiTheWitch
Associate

I have a custom board with a STMU5F7VJT, programmed over SWD, with an on board MMC and a usb connector. 

I am trying to access the onboard MMC with FileX and ThreadX. Using USBX, I can access the MMC just fine, and even format it from my computer, so MMC, ThreadX and DMA should be working fine. When trying to format the MCU through FileX however it hard faults during the synchronization deep in the ThreadX stack when calling tx_semaphore get() in the auto generated macro FX_STM32_MMC_WRITE_CPLT_NOTIFY().

Curiously, this hard fault only happens when the cpu is allowed to run. When manually stepping through, the hard fault never occurs. The hard fault is extremely cryptic. It fails within the function:

VOID  _tx_thread_system_suspend(TX_THREAD *thread_ptr)
#ifndef TX_NOT_INTERRUPTABLE
{

At the line of the macro "#ifndef TX_NOT_INTERRUPTABLE before entering the function proper.

I've increased the stack sizes/memory pool to a ludicrous amount, double checked memory alligned buffers and all of my non-rtos interrupts are priority 6 or higher. I've turned down the speed of the MMC all the way down to 26MHz and that didn't work either. The hard fault analyzer and registers don't show a lot of useful information either, all I get out is another cryptic address in SRAM that does not seem to correlate to any surrounding or related variables. 

0 REPLIES 0