arduino-bouffalo icon indicating copy to clipboard operation
arduino-bouffalo copied to clipboard

Ai-M61-32s dev kit issues

Open ITstreet1 opened this issue 1 year ago • 8 comments

Hi,

Thank you for your support for Bouffalo MCUs in Arduino IDE

I got this dev kit from AiThinker. I get the Done Uploading message when uploading any sketch, but the board isn't doing anything.

I have the latest version of your package. The PC sees the board. But not a simple Blink blinks the LED. This is the serial output:

Sketch uses 201304 bytes (4%) of program storage space. Maximum is 4190208 bytes. Global variables use 18464 bytes (9%) of dynamic memory, leaving 178144 bytes for local variables. Maximum is 196608 bytes. [10:06:05.120] - Serial port is COM5 [10:06:05.120] - ================================================== ConfigParser Error: [Errno 13] Permission denied: 'C:\Program Files (x86)\Arduino\config.ini' [10:06:05.121] - Program Start [10:06:05.121] - ========= eflash loader cmd arguments ========= [10:06:05.123] - serial port is COM5 [10:06:05.123] - chiptype: bl616 [10:06:05.123] - cpu_reset=False [10:06:05.137] - com speed: 2000000 [10:06:05.137] - ========= Interface is uart ========= [10:06:05.137] - Bootrom load [10:06:05.137] - ========= get_boot_info ========= [10:06:05.137] - ========= image get bootinfo ========= [10:06:05.415] - tx rx and power off, press the machine! [10:06:05.415] - cutoff time is 0.05 [10:06:05.479] - power on tx and rx [10:06:06.469] - reset cnt: 0, reset hold: 0.05, shake hand delay: 0.1 [10:06:06.469] - clean buf [10:06:06.470] - send sync [10:06:06.699] - ack is b'4f4b' [10:06:06.700] - shake hand success [10:06:07.212] - data read is b'010016060000010027128901db002bcf0eb499000f758010' [10:06:07.212] - ========= ChipID: b40ecf2b00db ========= [10:06:07.212] - Get bootinfo time cost(ms): 2074.920654296875 [10:06:07.212] - change bdrate: 2000000 [10:06:07.212] - Clock PLL set [10:06:07.214] - Set clock time cost(ms): 2.004638671875 [10:06:07.347] - Read mac addr [10:06:07.349] - MACADDR: b40ecf2b00db [10:06:07.350] - flash set para [10:06:07.350] - get flash pin cfg from bootinfo: 0x24 [10:06:07.350] - set flash cfg: 1014124 [10:06:07.350] - Set flash config [10:06:07.353] - Set para time cost(ms): 2.970947265625 [10:06:07.353] - ========= flash read jedec ID ========= [10:06:07.356] - Read flash jedec ID [10:06:07.356] - readdata: [10:06:07.356] - b'5e401700' [10:06:07.356] - Finished [10:06:07.358] - flash config Not found,use default [10:06:07.358] - jedec_id:5e4017 [10:06:07.358] - capacity_id:23 [10:06:07.358] - capacity:8.0M [10:06:07.358] - get flash size: 0x00800000 [10:06:07.358] - Program operation [10:06:07.359] - Warning: No input file to program to flash [10:06:07.359] - All time cost(ms): 2238.60205078125 [10:06:07.473] - close interface [10:06:07.473] - [All Success]


int led = 29; //cold LED is on IO29, tried RGB also
void setup() {
  pinMode(led, OUTPUT);
}
void loop() {
  digitalWrite(led, HIGH);
  delay(1000);
  digitalWrite(led, LOW);
  delay(1000);
}

Any help would be appreciated.

Regards

ITstreet1 avatar Sep 20 '23 08:09 ITstreet1

@ITstreet1

Hi, I noticed some errors in your log.

This error. ConfigParser Error: [Errno 13] Permission denied: 'C:\Program Files (x86)\Arduino\config.ini'

It looks like the program tool failed to create some configuration! So you downloaded a NULL bin.

You can try starting the Arduino IDE with administrator privileges and then programming it.

This appears to be a compatibility issue with our programming tools on Windows. He seems to be running fine on my computer. Anyway thanks for the test.

strongwong avatar Sep 21 '23 01:09 strongwong

Hi,

Thank you for your fast response. This did the trick.

Any idea how to solve this issue and not start IDE every time as administrator?

No matter, I will try a few examples to check it out. So far, so good.

PS.

In order to upload a sketch, I have to enter BOOT mode with buttons. Ai-Thinker didn't populate a few components. According to a schematic, it is intended for an auto-reset/auto-upload circuit, just like for ESP12f, or ESP32 modules. Can this be arranged in the same way for BL616?

https://docs.ai-thinker.com/_media/en/ai-m61-32s-kit_v1.1.0_specification.pdf

ITstreet1 avatar Sep 21 '23 07:09 ITstreet1

@ITstreet1 you can force launching IDE as administrator always, by C:\Program Files (x86)\Arduino\Arduino.exe , right click, properties, and enable Run this program as administrator: image

About auto-upload circuit, there are multiple auto-upload circuits. I see this circuit for BL616 for first time, but previous Bouffalo chips, as BL602 etc. used another circuit, just directly connecting the RTS and DTS to boot pin and reset pin. image

I am sure this reset circuit is implemented in Bouffalo DevCube

gamelaster avatar Sep 21 '23 08:09 gamelaster

What do you recommend for an auto-upload circuit? Direct connection of RTS and DTS pins to EN and IO8? And btw, here the boot is on IO2.

While looking at the schematic, I can see that the button IS NOT connected to the IO2, lol. I checked it with a multimeter and it is not connected. But while pressing the EN and IO2 buttons, I can enter the bootloader mode and upload the sketch.

ITstreet1 avatar Sep 21 '23 19:09 ITstreet1

As I mentioned, the circuit is for BL602, which have different pin specified for boot. And not sure, best would be ask Bouffalo engineers.

gamelaster avatar Sep 22 '23 04:09 gamelaster

Yes, the defualt BOOT pin of BL616/8 is IO2. At present, I don't have an Ai-M61-32s dev kit, so I can't test it yet, but IO2 seems to be NC on the schematic you shared.

strongwong avatar Sep 22 '23 07:09 strongwong

Ok, I made a few further GPIO tests, and here is what I got. This board has two LEDs on GPIO27 and GPIO29. It also has an RGB LED on GPIO12, 14, and 15. With a simple Blink sketch on this board only LEDs on GPIO29 and 15 work. There is nothing on those pins, either.

To enter the bootloader mode I must press the buttons combination when it starts uploading. If I press it earlier, the upload will fail.


Meanwhile, the Ai-M62-12f kit has arrived. It uses the same BL616 IC. The board is smaller than the Ai-M61-32s but the components look the same. It also has two LEDs and an RGB LED, but the pins are a little bit different.

Firstly, I have a hard time uploading a sketch. It is hard to get the right timing. But when I uploaded it, none of the LEDs worked.

This is the spec doc for the Ai-M62-12f kit https://docs.ai-thinker.com/_media/ai-m62-12f-kit_v1.0.0_specification.pdf

ITstreet1 avatar Oct 02 '23 09:10 ITstreet1

Hi,

Thank you for your support for Bouffalo MCUs in Arduino IDE

I got this dev kit from AiThinker. I get the Done Uploading message when uploading any sketch, but the board isn't doing anything.

I have the latest version of your package. The PC sees the board. But not a simple Blink blinks the LED. This is the serial output:

Sketch uses 201304 bytes (4%) of program storage space. Maximum is 4190208 bytes. Global variables use 18464 bytes (9%) of dynamic memory, leaving 178144 bytes for local variables. Maximum is 196608 bytes. [10:06:05.120] - Serial port is COM5 [10:06:05.120] - ================================================== ConfigParser Error: [Errno 13] Permission denied: 'C:\Program Files (x86)\Arduino\config.ini' [10:06:05.121] - Program Start [10:06:05.121] - ========= eflash loader cmd arguments ========= [10:06:05.123] - serial port is COM5 [10:06:05.123] - chiptype: bl616 [10:06:05.123] - cpu_reset=False [10:06:05.137] - com speed: 2000000 [10:06:05.137] - ========= Interface is uart ========= [10:06:05.137] - Bootrom load [10:06:05.137] - ========= get_boot_info ========= [10:06:05.137] - ========= image get bootinfo ========= [10:06:05.415] - tx rx and power off, press the machine! [10:06:05.415] - cutoff time is 0.05 [10:06:05.479] - power on tx and rx [10:06:06.469] - reset cnt: 0, reset hold: 0.05, shake hand delay: 0.1 [10:06:06.469] - clean buf [10:06:06.470] - send sync [10:06:06.699] - ack is b'4f4b' [10:06:06.700] - shake hand success [10:06:07.212] - data read is b'010016060000010027128901db002bcf0eb499000f758010' [10:06:07.212] - ========= ChipID: b40ecf2b00db ========= [10:06:07.212] - Get bootinfo time cost(ms): 2074.920654296875 [10:06:07.212] - change bdrate: 2000000 [10:06:07.212] - Clock PLL set [10:06:07.214] - Set clock time cost(ms): 2.004638671875 [10:06:07.347] - Read mac addr [10:06:07.349] - MACADDR: b40ecf2b00db [10:06:07.350] - flash set para [10:06:07.350] - get flash pin cfg from bootinfo: 0x24 [10:06:07.350] - set flash cfg: 1014124 [10:06:07.350] - Set flash config [10:06:07.353] - Set para time cost(ms): 2.970947265625 [10:06:07.353] - ========= flash read jedec ID ========= [10:06:07.356] - Read flash jedec ID [10:06:07.356] - readdata: [10:06:07.356] - b'5e401700' [10:06:07.356] - Finished [10:06:07.358] - flash config Not found,use default [10:06:07.358] - jedec_id:5e4017 [10:06:07.358] - capacity_id:23 [10:06:07.358] - capacity:8.0M [10:06:07.358] - get flash size: 0x00800000 [10:06:07.358] - Program operation [10:06:07.359] - Warning: No input file to program to flash [10:06:07.359] - All time cost(ms): 2238.60205078125 [10:06:07.473] - close interface [10:06:07.473] - [All Success]


int led = 29; //cold LED is on IO29, tried RGB also
void setup() {
  pinMode(led, OUTPUT);
}
void loop() {
  digitalWrite(led, HIGH);
  delay(1000);
  digitalWrite(led, LOW);
  delay(1000);
}

Any help would be appreciated.

Regards

On my Ai-M62-12f kit only BLUE led (IO15) and IO29 work

mtuxpe avatar Jan 27 '24 17:01 mtuxpe