ESP Programming

For general Flowcode discussion that does not belong in the other sections.
Post Reply
mnfisher
Valued Contributor
Posts: 1454
http://meble-kuchenne.info.pl
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 135 times
Been thanked: 708 times

ESP Programming

Post by mnfisher »

Just trying to get ESP programming working - and encountered a few things which I'm not sure about..

1) If the program 'falls' off the end (loop: goto loop) then I get watchdog timer fired - program didn't respond in time - message on the uart. This is if auto clear watchdog is set/not set. It doesn't occur during program execution.
2) I tried to add a software UART - the interrupts on timer0..3 only give an allowable interval of 256 and 1000. Resolution of ms or seconds. Is this correct?
3) When I added the software uart - I had SoftUART::Initialise() - in a disabled macro. This stopped compilation with a raft of error messages. If pins are set correctly (or macro deleted) this doesn't happen. But should FC add the code even for a disabled macro??
4) The pins for hardware SPI channel don't seem to auto-select correctly. (It does but there should be 2 channels vspi and hspi)
5) The chip view diagram doesn't zoom on enlarging the window.
6) Some of the pin defs are incorrect (top of rhs in diagram) The pin diagram shows the pinout from below - so is mirrored to the usual way of looking at things... see https://resource.heltec.cn/download/WiF ... ram_V2.pdf

Martin

mnfisher
Valued Contributor
Posts: 1454
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 135 times
Been thanked: 708 times

Re: ESP Programming

Post by mnfisher »

Using CAL SPI - if 'use chip references' is unticked - then, for example, having (Software mode) MOSI = $pin15 gives compilation error (port5 doesn't exist did you mean portA?)

Should there be 2 available channels for SPI?

Martin

BenR
Matrix Staff
Posts: 1926
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 686 times

Re: ESP Programming

Post by BenR »

Hi Martin,

Looks like we currently only support the HSPI, I'll see if we can also support the VSPI to provide a second hardware channel.

1) At the end of the program there is a while 1 loop, it could be that inside the loop the RTOS driving the ESP has a hardtime doing other things like resetting the watchdog. Maybe we can do something like add a delay to the loop to prevent this error.

2) Leigh may be able to comment better on this one.

3) I think this is just how Flowcode works at the moment, a reference to a component, disabled or not includes the code for that component. We can maybe look at removing this but it might be much easier said then done,

5) The mouse wheel should allow you to zoom in on the chip view with the window selected.

6) Let me investigate this for you.

mnfisher
Valued Contributor
Posts: 1454
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 135 times
Been thanked: 708 times

Re: ESP Programming

Post by mnfisher »

Thanks Ben,

Mouse wheel - that's great. Now I can read the pin labels... 5v & 3.3v swapped top RHS, VEXT marked as GND pin 4...

#warning "esp_event_loop.h is deprecated, please include esp_event.h instead"


Martin

BenR
Matrix Staff
Posts: 1926
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 686 times

Re: ESP Programming

Post by BenR »

Hello,

Some good news, with a bit of playing around with the code I've managed to enable the second SPI channel and also improved the prescaler frequency selection to give more options and list the actual output frequencies. These updates should now all be available via the update system.

Let me know if there are any additional prescaler frequencies you would like to see. 80MHz operation is now possible but only using very small traces. In practise a lot of applications won't be able to acheive these speeds due to trace or cable length.

Thanks for bringing the missing second channel to our attention.

BenR
Matrix Staff
Posts: 1926
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 686 times

Re: ESP Programming

Post by BenR »

In regards to this.
Task watchdog got triggered. The following tasks did not reset the watchdog in time
If you're getting this then you need to add a delay into your program loop, the background tasks are never being allowed to run and eventually are causing the entire system to reset. Adding a delay allows the background tasks to do their business and the problem should go away.

Post Reply