Search found 11 matches

by coderooni
Fri Jun 02, 2023 6:44 am
Forum: General Discussion
Topic: UART Interrupt without UART driver
Replies: 9
Views: 4803

Re: UART Interrupt without UART driver

Is your ISR called and crashes, or does enabling the IRQ crash already? Not sure about ESP32, but on many platforms, including Atmel AVR, an ISR is different from a normal C function in that it needs a special pro-&epilogue to save and restore the full context (CPU registers...) it interrupted. My ...
by coderooni
Thu Jun 01, 2023 3:07 pm
Forum: General Discussion
Topic: UART Interrupt without UART driver
Replies: 9
Views: 4803

Re: UART Interrupt without UART driver

Okay, so the thing is, to attach an interrupt you need to use at least a little bit of higher-level code. In the end, you're working with ESP-IDF, and even if you're not using it, per default it does have control over the interrupt vector table. Go look here for more information. You want to call e...
by coderooni
Sat May 27, 2023 11:12 am
Forum: General Discussion
Topic: UART Interrupt without UART driver
Replies: 9
Views: 4803

Re: UART Interrupt without UART driver

'Bare metal' = poking the hardware directly, like on an ATMega. This can be done on an ESP32, but it generally isn't how most things are coded and as such there's not that much documentation on it; given that the ESP32 is a more complex beast, both in hardware and software, there's also lots more t...
by coderooni
Fri May 26, 2023 5:32 pm
Forum: General Discussion
Topic: UART Interrupt without UART driver
Replies: 9
Views: 4803

Re: UART Interrupt without UART driver

Suggest you read the technical reference manual (in as far as you haven't already) to handle interrupts on the UART side, but to connect the interrupt to an ISR, it'd be best to use esp_intr_alloc . You can do it by poking directly into the relevant registers as well, but since the ESP32 does run a...
by coderooni
Tue Apr 18, 2023 3:23 pm
Forum: General Discussion
Topic: Configuring UART registers and peripheral clock
Replies: 9
Views: 3916

Re: Configuring UART registers and peripheral clock

From memory, the Tx fifo starts sending as soon as you write a byte to it. The idea of the FIFO is that you can write a fair amount of data into it in one go, faster than the data is sent; if you're doing the sending interrupt-based, it means you don't have to fire an interrupt every byte. I see. E...
by coderooni
Mon Apr 17, 2023 9:29 pm
Forum: General Discussion
Topic: Configuring UART registers and peripheral clock
Replies: 9
Views: 3916

Re: Configuring UART registers and peripheral clock

I think the link I posted (to the low-level driver code) covers most of it. It's not really a complex concept. Thanks Sprite, it indeed wasn't a deep topic. I didn't get much time after that to finish what I started. I was diving into the UART section of the TRM and everything is clear except the p...
by coderooni
Sat Apr 08, 2023 10:39 am
Forum: General Discussion
Topic: Configuring UART registers and peripheral clock
Replies: 9
Views: 3916

Re: Configuring UART registers and peripheral clock

It works for UART0 as that is the default UART for debug messages; it already is de-clockgated by default. The TRM doesn't really seem to refer to peripheral clock-gating and reset functionality (it only documents the registers used for it), that seems like an omission and I'll file an issue to cor...
by coderooni
Thu Apr 06, 2023 12:49 am
Forum: General Discussion
Topic: Where is UART Tx register
Replies: 1
Views: 1182

Re: Where is UART Tx register

Hi Ali,

Did you manage to find what address the TX buffer is located at to write into? Thanks!
by coderooni
Thu Apr 06, 2023 12:17 am
Forum: General Discussion
Topic: Configuring UART registers and peripheral clock
Replies: 9
Views: 3916

Re: Configuring UART registers and peripheral clock

Make sure you de-clockgate and de-reset UART1, otherwise it'll indeed not do much. Basically, do this for UART1. I responded to this but it hasn't gotten approved yet? What I replied with was thank you for providing me with the link. Why do we need to de-clockgate and de-reset the peripheral clock ...
by coderooni
Wed Apr 05, 2023 12:43 am
Forum: General Discussion
Topic: Configuring UART registers and peripheral clock
Replies: 9
Views: 3916

Re: Configuring UART registers and peripheral clock

Make sure you de-clockgate and de-reset UART1, otherwise it'll indeed not do much. Basically, do this for UART1. Thank you for the link. So, reading in the register values after resetting them will result in the correct values? Does the TRM indicate resetting certain register values because as far ...