Hi am currently trying to implement a sensor using SENT protocol on a S32K312 microcontroller (RTD v4.0.0).
Even if the ISR is working, I would like to use the DMA to take a load off the CPU. I followed the instruction for the tresos configuration and there seems to be a problem: when the DMA ISR is called, the DMA destination buffer is filled with 0s (which is set by the ISR when decoding the buffer).
I changed the driver to insert 0xFFFFFFFF to check if the TIMCMP might held a 0 value but I saw the 0xFFFFFFFF value un changed. Meaning the the value was not written at all at the destination address.
The thing is, the buffer is not always filled with invalid value, on 0.1% of the value, there's a valid capture.
I synchronized a breakpoint with a logic analyzer trigger and capture some value. I have attached the following files:
- capture_isr_registers_value.jpg: the value of TIMCMP[0], TCD0_SADDR, TCD0_DADDR and CH0_ES
- capture_isr_data.jpg: the DMA buffer
- capature_isr.jpg: the logic analyzer screenshot
Solved! Go to Solution.
Hi @pgelinas345,
It could be caused by the cache.
Can you place the buffers in a non-cacheable region?
#pragma GCC section bss ".mcal_bss_no_cacheable"
uint8_t buffer;
#pragma GCC section bss
Or invalidate the cache at the address of the buffer.
There are APIs in Cache_Ip.h
Regards,
Daniel
Hi @pgelinas345,
It could be caused by the cache.
Can you place the buffers in a non-cacheable region?
#pragma GCC section bss ".mcal_bss_no_cacheable"
uint8_t buffer;
#pragma GCC section bss
Or invalidate the cache at the address of the buffer.
There are APIs in Cache_Ip.h
Regards,
Daniel