using the SPI flash pins for other things
using the SPI flash pins for other things
I understand the SPI flash pins can be used as general GPIO. But if there is no flash chip connected, the part will not run an application or even possibly boot. So the flash has to be connected. I assume this means that after the part boots and the program is loaded, then the flash pins can be re purposed. How would I prevent the part from trying to access the flash while I am using the pins for something else?
Re: using the SPI flash pins for other things
No, the entire program is not copied to ram and executed. Instead there is a small cache where code from flash gets loaded and executed and this is continually being refreshed.
- Vader_Mester
- Posts: 300
- Joined: Tue Dec 05, 2017 8:28 pm
- Location: Hungary
- Contact:
Re: using the SPI flash pins for other things
kbaud: Can you explain why you would need those extra pins? Maybe we could provide an alternative solution.
Vader[BEN]
Vader[BEN]
Code: Select all
task_t coffeeTask()
{
while(atWork){
if(!xStreamBufferIsEmpty(mug)){
coffeeDrink(mug);
} else {
xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
}
}
vTaskDelete(NULL);
}
Re: using the SPI flash pins for other things
Sure, we have used up all the GPIO and we need these pins for PWM output for motor control.
Re: using the SPI flash pins for other things
How do can I configure ESP32 to only use SPI dual (not quad) mode for all flash interface during normal program operation and also configure GPIO 9 & 10 for other use? Is this possible to do on ESP-VROOM-32?
-
- Posts: 9708
- Joined: Thu Nov 26, 2015 4:08 am
Re: using the SPI flash pins for other things
You can set that in make menuconfig, 'serial flasher config' -> 'flash SPI mode'; that also configures the runtime configuration. Note that on the ESP-Wrover modules, the GPIOs still are physically connected to the HOLD and WP of the internal flash chip; pulling these flash pins high or low may lead to unexpected results.
- Vader_Mester
- Posts: 300
- Joined: Tue Dec 05, 2017 8:28 pm
- Location: Hungary
- Contact:
Re: using the SPI flash pins for other things
You should use a GPIO extender with SPI (or I2C) to use the generaly used GPIO pins, and for PWM and other things use the ESP32.kbaud1 wrote:Sure, we have used up all the GPIO and we need these pins for PWM output for motor control.
Additionally, you can use a cheap 8bit microcontroller for GPIO handling.
I suggest this microcontroller (this family). It is an 8bit micro, with 72MHZ clock, SPI master-slave, 14bit ADC, DAC, PWM, etc.
Should be used with the ESP32 as SPI slave.
It also comes with an embeded bootloader, which doesn't require programming equipment just a UART-USB interface.
Price is around $1, so costs nearly nothing.
(Actually this is what I'm planning to use in my project).
Code: Select all
task_t coffeeTask()
{
while(atWork){
if(!xStreamBufferIsEmpty(mug)){
coffeeDrink(mug);
} else {
xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
}
}
vTaskDelete(NULL);
}
Re: using the SPI flash pins for other things
thank you, I have been looking at the EFM8 actually. already have a dev kit.
Who is online
Users browsing this forum: Baidu [Spider] and 55 guests