memcpy not working on esp32c3

floitsch_toit
Posts: 43
Joined: Wed Jun 29, 2022 4:25 pm
Location: Aarhus, Denmark
Contact:

memcpy not working on esp32c3

Postby floitsch_toit » Sun Dec 07, 2025 2:02 pm

I'm implementing an RMT encoder using the Simple Callback Encoder (https://docs.espressif.com/projects/esp ... ck-encoder).

I'm using a simple 'memcpy' to copy my data into the buffer. This seems to work fine on the ESP32, but on the ESP32C3 the data in the target isn't the same as the source.
From what I can tell, the 'symbols' buffer is directly backed by the actual hardware, so I suspect that 'memcpy' doesn't copy correctly into hardware buffers?

Is this a known issue?
I'm running on 5.4.1, and haven't yet had the time to test on a more recent SDK version. If this issue has likely been fixed, please let me know. I went through the commit logs, but didn't see anything that was relevent.

MicroController
Posts: 2661
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: memcpy not working on esp32c3

Postby MicroController » Sun Dec 07, 2025 11:19 pm

I suspect that 'memcpy' doesn't copy correctly into hardware buffers?
Indeed, memcpy is not suited for peripheral registers: You must use 32-bit accesses on all the registers, which memcpy most likely doesn't know.

floitsch_toit
Posts: 43
Joined: Wed Jun 29, 2022 4:25 pm
Location: Aarhus, Denmark
Contact:

Re: memcpy not working on esp32c3

Postby floitsch_toit » Thu Dec 11, 2025 7:36 am

My patch to the documentation just got merged.
https://github.com/espressif/esp-idf/pull/17993

Who is online

Users browsing this forum: Baidu [Spider], ChatGPT-User, PetalBot, Qwantbot and 4 guests