Nina w arduino - gpio blink

#include <Arduino.h>

const int ledPin = GPIO_NUM_21;

void setup() {
pinMode (ledPin, OUTPUT);
}

void loop() {
digitalWrite (ledPin, HIGH); // turn on the LED
delay(500); // wait for half a second or 500 milliseconds
digitalWrite (ledPin, LOW); // turn off the LED
delay(500); // wait for half a second or 500 milliseconds
}

In GPIO21 there is a LED, after runs this program nothing happens!

Can you see that ?

[env:nina_w10]
platform = espressif32
board = nina_w10
framework = arduino

Try

const int ledPin = D21;

What happens now?

Hello friend!

Nothing happens too!

then set ledPin = 21 directly?

I tried too!
No blinks !

oO Did you set the required jumper to connect IO-21 to the LED?

yes i did! Connected the jumper!

I uploaded the exact same Nina W10 code with GPIO_NUM_21 and platformio.ini to my ESP32 development board, and it blinks IO-21 without a problem.

(Not suprising since the Nina W10 is also just a ESP32 target with the same code running on it, so a change in development board doesn’t make difference here…)

So I strongly sense you have a hardware issue. Please check if you see a 3.3V / 0V switching on IO-21 on J2 using a multimeter (or a LED with resistor). Lower the frequency if necessary.

Thanks to test it!
Looks that is some partition problem that make the application not runs on NINA W, because i remember that on ARDUINO IDE works nice the blink!

These are the address that worked on ARDUINO IDE to NINA W

C:\Program Files (x86)\Arduino\hardware\espressif\esp32/tools/esptool.exe
–chip esp32 --port COM43 --baud 921600 --before default_reset --after hard_reset write_flash -z
–flash_mode dio --flash_freq 40m
–flash_size detect
0xe000 C:\Program Files (x86)\Arduino\hardware\espressif\esp32/tools/partitions/boot_app0.bin
0x1000 C:\Program Files (x86)\Arduino\hardware\espressif\esp32/tools/sdk/bin/bootloader_dio_40m.bin
0x10000 C:\Users\TCPIPC~1\AppData\Local\Temp\arduino_build_13062/ninaw.ino.bin
0x8000 C:\Users\TCPIPC~1\AppData\Local\Temp\arduino_build_13062/ninaw.ino.partitions.bin
esptool.py v2.3.1

on ARDUINO IDE WORKS

Looks a partition problem on PLATFORMIO config!

O sketch usa 159877 bytes (12%) de espaço de armazenamento para programas. O máximo são 1310720 bytes.
Variáveis globais usam 11056 bytes (3%) de memória dinâmica, deixando 283856 bytes para variáveis locais. O máximo são 294912 bytes.
C:\Program Files (x86)\Arduino\hardware\espressif\esp32/tools/esptool.exe --chip esp32 --port COM43 --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 40m --flash_size detect 0xe000 C:\Program Files (x86)\Arduino\hardware\espressif\esp32/tools/partitions/boot_app0.bin 0x1000 C:\Program Files (x86)\Arduino\hardware\espressif\esp32/tools/sdk/bin/bootloader_dio_40m.bin 0x10000 C:\Users\TCPIPC~1\AppData\Local\Temp\arduino_build_651072/sketch_sep17a.ino.bin 0x8000 C:\Users\TCPIPC~1\AppData\Local\Temp\arduino_build_651072/sketch_sep17a.ino.partitions.bin
esptool.py v2.3.1
Connecting…__
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core
Uploading stub…
.
.
.
works very nice the program on NINA W.

Can you verify how to modify manually the partition parameters on platformo arduino framework to nina w ?

Please, see if possible change the partion parameters in the plataform.ini to nina w
Thank you friend!

I don’t see how partition tables would change anything. They just change the sizes / available space for the program (APP0, APP1), SPIFFS etc. If the firmware compiles on both versions, it can’t be the problem, especially not for this blink program.

I’m stunned why a simple blink should not work with PIO but with Arduino IDE. Can you upload both produced ELF files? (for PIO: .pioenvs/ninaw10/firmware.elf)

yes!!!

Of course! :slight_smile:

https://furb-my.sharepoint.com/:u:/g/personal/maw_furb_br/EWi7wDGtSIRCiuoEskUED6YBJESSvEoz3S7HfEJdUiqpiQ?e=kDnXqx

https://furb-my.sharepoint.com/:u:/g/personal/maw_furb_br/EVdtudWM63BOuiExakfngf4BibNiwdXf7XxeqOjJGFdBgg?e=5W60R5

Hi,

I tested in other machine (i instaled platformio) and occurs the same problem! On ARDUINO IDE works, but on PLATFORMIO Arduino framework not runs!

maybe this help you

arduino
rst:0x1 (POWERON_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:812
load:0x40078000,len:0
load:0x40078000,len:11584
entry 0x40078a60

Platformio
rst:0x1 (POWERON_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:952
load:0x40078000,len:6084
load:0x40080000,len:7944
entry 0x40080310
user code done

Does flashing succeed with PIO? (‘SUCCESS’ message?)

i am not in Home now! I am in the classroom! send a picture of (‘SUCCESS’ message?), and i will compare when back home

Look

Executing task in folder blink: C:\Users\tcpipchip.platformio\penv\Scripts\platformio.exe run --target upload <

Processing nina_w10 (platform: espressif32; board: nina_w10; framework: arduino)

Verbose mode can be enabled via -v, --verbose option
PLATFORM: Espressif 32 > u-blox NINA-W10 series
SYSTEM: ESP32 240MHz 320KB RAM (2MB Flash)
Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
LDF MODES: FINDER(chain) COMPATIBILITY(soft)
Collected 24 compatible libraries
Scanning dependencies…
No dependencies
Retrieving maximum program size .pioenvs\nina_w10\firmware.elf
Checking size .pioenvs\nina_w10\firmware.elf
Memory Usage → Redirecting...
DATA: [ ] 4.2% (used 13884 bytes from 327680 bytes)
PROGRAM: [= ] 13.6% (used 178020 bytes from 1310720 bytes)
Configuring upload protocol…
AVAILABLE: esptool
CURRENT: upload_protocol = esptool
Looking for upload port…
Auto-detected: COM43
Uploading .pioenvs\nina_w10\firmware.bin
Serial port COM43
Connecting…
Chip is ESP32D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core
MAC: 30:ae:a4:3e:17:b4
Uploading stub…
Running stub…
Stub running…
Changing baud rate to 921600
Changed.
Configuring flash size…
Auto-detected Flash size: 2MB
Flash params set to 0x0210
Compressed 15088 bytes to 9755…
Wrote 15088 bytes (9755 compressed) at 0x00001000 in 0.1 seconds (effective 950.4 kbit/s)…
Hash of data verified.
Compressed 3072 bytes to 134…
Wrote 3072 bytes (134 compressed) at 0x00008000 in 0.0 seconds (effective 1536.0 kbit/s)…
Hash of data verified.
Compressed 8192 bytes to 47…
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.0 seconds (effective 4096.0 kbit/s)…
Hash of data verified.
Compressed 178160 bytes to 89694…
Wrote 178160 bytes (89694 compressed) at 0x00010000 in 2.9 seconds (effective 489.5 kbit/s)…
Hash of data verified.

Leaving…
Hard resetting via RTS pin…
===================================================================== [SUCCESS] Took 8.37 seconds =====================================================================

Terminal will be reused by tasks, press any key to close it.

Hm OK so it uploads correctly. I’ll check the ELF for differences in code…