Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN,
Hello,
I am using a TMS570LS3137 with HALCoGen 4.07.01, CCS 12.2 and TI ARM Compiler 20.2.7.LTS.
The project is compiled with optimization disabled:
-mv7R4
--code_state=32
-Ooff
--abi=eabi
Two UART receive paths are used in the application:
1. sciREG:
VIM channel: 74ISR: comp_pod_sci_low_level_interruptReceive interrupt vector: INTVECT1 == 11
2. scilinREG:
VIM channel: 27ISR: comp_maintenance_sci_low_level_interruptReceive interrupt vector: INTVECT1 == 11
Both peripherals are configured with UART_INT_LEVEL_1. The same issue is observed on both interrupt paths.
I have UART receive ISRs declared as follows:
#pragma CODE_STATE(comp_pod_sci_low_level_interrupt, 32) #pragma INTERRUPT(comp_pod_sci_low_level_interrupt, IRQ)
void comp_pod_sci_low_level_interrupt(void) { if (g_s_cp != NULL) { uint32_t vec = g_s_cp->pod_com.instance->INTVECT1;
if (11U == vec) { uint8_t received_data =(uint8_t)(g_s_cp->pod_com.instance->RD & 0x00FFU);
comp_pod_ring_buf_put(g_s_cp, received_data); } } }
The called function is:
static result_enum_t comp_pod_ring_buf_put(comp_pod_struct_t *const p_cp, uint8_t data) { if (NULL == p_cp) { return RESULT_ERR_NULL; }
uint16_t next = (p_cp->ring_buf.head + 1U) & POD_RING_BUF_MASK;
if (next != p_cp->ring_buf.tail) { p_cp->ring_buf.buffer[p_cp->ring_buf.head] = data; p_cp->ring_buf.head = next; }
return RESULT_SUCCESS; }
When comp_pod_ring_buf_put() is called from the ISR, the board's ECC/nERROR LED becomes active.
However, the application continues running normally. It does not remain in ramErrorReal, flashErrorReal or another data-abort loop.
If I copy the same ring-buffer operations directly into the ISR, the LED does not become active:
uint16_t next = (g_s_cp->ring_buf.head + 1U) & POD_RING_BUF_MASK;
if (next != g_s_cp->ring_buf.tail) { g_s_cp->ring_buf.buffer[g_s_cp->ring_buf.head] = received_data;
g_s_cp->ring_buf.head = next; }
The same behavior is observed in another UART component with an equivalent ring-buffer function.
I also increased the IRQ stack from 0x100 bytes to 0x400 bytes and adjusted the linker RAM boundaries accordingly. This did not change the behavior, so a simple IRQ stack overflow does not appear to be the cause.
Because optimization is disabled, the function is not inlined. Calling it adds a BL instruction, executes code from another Flash address and creates an additional function stack frame. Copying the function body into the ISR avoids these operations.
What could be causing this problem?
Best regards,
Hasan