Check all modifikators of type declarations
All local variables and functions should be declared static.
All global variables/contexts/etc should be declared volatile.
Fun reading which mirrors our problems xD @Martin.dold @evileli
Maybe this struct in hal_uart.c is the problem. The pointers are declared volatile, but not the variables they are pointing to?
#define UART_RX_DATA_BUF_SIZE 8192 #define UART_TX_DATA_BUF_SIZE 8192 #define IS_BUF_EMPTY(x, y) (x == y) /*! Structure defining the context of an UART port. */ struct S_HAL_UART_CTX_T { uint32_t ui32_baseAddr; volatile uint8_t ac_rxData[UART_RX_DATA_BUF_SIZE]; volatile uint8_t *pc_rxDataWrite; volatile uint8_t *pc_rxDataRead; volatile uint8_t ac_txData[UART_TX_DATA_BUF_SIZE]; volatile uint8_t *pc_txDataWrite; volatile uint8_t *pc_txDataRead; };