bouffalolab / arduino-bouffalo

Arduino core for the BouffaloLab chips
Apache License 2.0
27 stars 3 forks source link

Sipeed M0S Dock? #3

Open WitoTV opened 1 year ago

WitoTV commented 1 year ago

Hello,

First of all, thank you so much for making efforts to include Arduino environment for BL616.

Now to the real issue... I'm having some problems with getting Arduino code to run on my M0S Dock. Not sure if I somehow fried the board or it's something with the code or I am missing some important step I was supposed to do before trying to install Arduino on it. I could use some insight...

Code I'm trying to run:

int ledPin = 27; // or 28  
void setup() {
  Serial.begin(2000000);
  pinMode(ledPin, OUTPUT);
}
void loop() {
  Serial.println("Hello world!");
  digitalWrite(ledPin, HIGH);
  delay(1000);
  digitalWrite(ledPin, LOW);
  delay(1000);
}

Based on the log file I tried everything seems ok but I am not getting any reactions on the onboard led or in serial monitor.

Sketch uses 201576 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:56:00.936] - Serial port is COM5
[10:56:00.936] - ==================================================
[10:56:00.939] - Program Start
[10:56:00.939] - ========= eflash loader cmd arguments =========
[10:56:00.940] - serial port is COM5
[10:56:00.940] - chiptype: bl616
[10:56:00.940] - cpu_reset=False
[10:56:00.954] - com speed: 2000000
[10:56:00.955] - ========= Interface is uart =========
[10:56:00.955] - Bootrom load
[10:56:00.955] - ========= get_boot_info =========
[10:56:00.955] - ========= image get bootinfo =========
[10:56:01.229] - tx rx and power off, press the machine!
[10:56:01.230] - cutoff time is 0.05
[10:56:01.291] - power on tx and rx
[10:56:02.282] - reset cnt: 0, reset hold: 0.05, shake hand delay: 0.1
[10:56:02.282] - clean buf
[10:56:02.284] - send sync
[10:56:02.499] - ack is b'4f4b'
[10:56:02.500] - shake hand success
[10:56:03.009] - data read is b'01001606000001002792800157ad35cf0eb415000f758010'
[10:56:03.009] - ========= ChipID: b40ecf35ad57 =========
[10:56:03.009] - Get bootinfo time cost(ms): 2054.232177734375
[10:56:03.009] - change bdrate: 2000000
[10:56:03.009] - Clock PLL set
[10:56:03.009] - Set clock time cost(ms): 0.0
[10:56:03.133] - Read mac addr
[10:56:03.133] - MACADDR: b40ecf35ad57
[10:56:03.133] - flash set para
[10:56:03.133] - get flash pin cfg from bootinfo: 0x02
[10:56:03.133] - set flash cfg: 1014102
[10:56:03.133] - Set flash config
[10:56:03.134] - Set para time cost(ms): 1.00048828125
[10:56:03.134] - ========= flash read jedec ID =========
[10:56:03.135] - Read flash jedec ID
[10:56:03.135] - readdata:
[10:56:03.135] - b'c8601600'
[10:56:03.135] - Finished
[10:56:03.135] - flash config Not found,use default
[10:56:03.135] - jedec_id:c86016
[10:56:03.135] - capacity_id:22
[10:56:03.135] - capacity:4.0M
[10:56:03.135] - get flash size: 0x00400000
[10:56:03.135] - Program operation
[10:56:03.135] - Dealing Index 0
[10:56:03.135] - ========= programming C:\Users\REDACTED\AppData\Local\Temp\arduino\sketches\1C6A901E8F35DC54ADA3225EA387E0FF\sketch_nov19a.ino.bin to 0x0
[10:56:03.135] - flash para file: C:\Users\REDACTED\AppData\Local\Arduino15\packages\bouffalolab\tools\bflb_flash_tools\1.0.7\chips/bl616/efuse_bootheader/flash_para.bin
[10:56:03.135] - Set flash config
[10:56:03.137] - Set para time cost(ms): 2.00048828125
[10:56:03.137] - ========= flash load =========
[10:56:03.137] - ========= flash erase =========
[10:56:03.137] - Erase flash  from 0x0 to 0x34fcf
[10:56:03.677] - Erase time cost(ms): 540.217529296875
[10:56:03.722] - decompress flash load 121716
[10:56:03.747] - Load 2048/121716 {"progress":1}
[10:56:03.763] - Load 4096/121716 {"progress":3}
[10:56:03.772] - Load 6144/121716 {"progress":5}
[10:56:03.788] - Load 8192/121716 {"progress":6}
[10:56:03.803] - Load 10240/121716 {"progress":8}
[10:56:03.819] - Load 12288/121716 {"progress":10}
[10:56:03.834] - Load 14336/121716 {"progress":11}
[10:56:03.850] - Load 16384/121716 {"progress":13}
[10:56:03.858] - Load 18432/121716 {"progress":15}
[10:56:03.874] - Load 20480/121716 {"progress":16}
[10:56:03.889] - Load 22528/121716 {"progress":18}
[10:56:03.898] - Load 24576/121716 {"progress":20}
[10:56:03.914] - Load 26624/121716 {"progress":21}
[10:56:03.929] - Load 28672/121716 {"progress":23}
[10:56:03.945] - Load 30720/121716 {"progress":25}
[10:56:03.961] - Load 32768/121716 {"progress":26}
[10:56:03.976] - Load 34816/121716 {"progress":28}
[10:56:03.993] - Load 36864/121716 {"progress":30}
[10:56:04.008] - Load 38912/121716 {"progress":31}
[10:56:04.024] - Load 40960/121716 {"progress":33}
[10:56:04.040] - Load 43008/121716 {"progress":35}
[10:56:04.055] - Load 45056/121716 {"progress":37}
[10:56:04.064] - Load 47104/121716 {"progress":38}
[10:56:04.080] - Load 49152/121716 {"progress":40}
[10:56:04.095] - Load 51200/121716 {"progress":42}
[10:56:04.111] - Load 53248/121716 {"progress":43}
[10:56:04.127] - Load 55296/121716 {"progress":45}
[10:56:04.136] - Load 57344/121716 {"progress":47}
[10:56:04.151] - Load 59392/121716 {"progress":48}
[10:56:04.167] - Load 61440/121716 {"progress":50}
[10:56:04.182] - Load 63488/121716 {"progress":52}
[10:56:04.198] - Load 65536/121716 {"progress":53}
[10:56:04.207] - Load 67584/121716 {"progress":55}
[10:56:04.222] - Load 69632/121716 {"progress":57}
[10:56:04.238] - Load 71680/121716 {"progress":58}
[10:56:04.254] - Load 73728/121716 {"progress":60}
[10:56:04.269] - Load 75776/121716 {"progress":62}
[10:56:04.278] - Load 77824/121716 {"progress":63}
[10:56:04.294] - Load 79872/121716 {"progress":65}
[10:56:04.310] - Load 81920/121716 {"progress":67}
[10:56:04.326] - Load 83968/121716 {"progress":68}
[10:56:04.341] - Load 86016/121716 {"progress":70}
[10:56:04.350] - Load 88064/121716 {"progress":72}
[10:56:04.365] - Load 90112/121716 {"progress":74}
[10:56:04.380] - Load 92160/121716 {"progress":75}
[10:56:04.389] - Load 94208/121716 {"progress":77}
[10:56:04.404] - Load 96256/121716 {"progress":79}
[10:56:04.420] - Load 98304/121716 {"progress":80}
[10:56:04.436] - Load 100352/121716 {"progress":82}
[10:56:04.444] - Load 102400/121716 {"progress":84}
[10:56:04.460] - Load 104448/121716 {"progress":85}
[10:56:04.476] - Load 106496/121716 {"progress":87}
[10:56:04.491] - Load 108544/121716 {"progress":89}
[10:56:04.508] - Load 110592/121716 {"progress":90}
[10:56:04.532] - Load 112640/121716 {"progress":92}
[10:56:04.550] - Load 114688/121716 {"progress":94}
[10:56:04.573] - Load 116736/121716 {"progress":95}
[10:56:04.589] - Load 118784/121716 {"progress":97}
[10:56:04.605] - Load 120832/121716 {"progress":99}
[10:56:04.616] - Load 121716/121716 {"progress":100}
[10:56:04.616] - Load 121716/121716 {"progress":100}
[10:56:04.616] - Write check
[10:56:04.618] - Flash load time cost(ms): 938.994140625
[10:56:04.618] - Finished
[10:56:04.618] - Sha caled by host: 5e7f09b66a1266ba515fedef1f3e55307857e2e5956ddb4370a084827ef5ff29
[10:56:04.618] - xip mode Verify
[10:56:04.798] - Read Sha256/217040
[10:56:04.798] - Flash xip readsha time cost(ms): 179.3662109375
[10:56:04.798] - Finished
[10:56:04.798] - Sha caled by dev: 5e7f09b66a1266ba515fedef1f3e55307857e2e5956ddb4370a084827ef5ff29
[10:56:04.799] - Verify success
[10:56:04.800] - Program Finished
[10:56:04.800] - All time cost(ms): 3860.84912109375
[10:56:04.912] - close interface
[10:56:04.912] - [All Success]
gamelaster commented 1 year ago

Did you have attached UART to R / X / G pins? Also, this might be failure of board_init, due it expect pSRAM

WitoTV commented 1 year ago

Did you have attached UART to R / X / G pins?

No, I did not... Was I supposed to? I was expecting it to work via the USB C port on the board (well it worked for detection after holding boot button on the board and plugging it in). I sadly don't have a converter at my place currently to check with it... I would be able to get it back tomorrow earlies... So I could update on that after I get it in my hands...

Also, this might be failure of board_init, due it expect pSRAM

What can I do if that would end up being the case? I remember reading something about pSRAM issues with some Wi-Fi exampels when Wi-Fi/Bluetooth APIs were publicised for the SDK but I don't remember what was the exact topic...

WitoTV commented 1 year ago

@gamelaster update. I got my hands on the USB/UART converter and connected it to dedicated R/T/G pins on the M0S Dock. No effect, Arduino does not even want to connect to serial when used this way... Should I try to connect to it with something else?

(I have as well a nondock version of M0S, I could try to wire it up with some enamelled wire (first I need to find where to buy some here) to some pins and breadboard and see if I could get that running...)

Opisek commented 7 months ago

@WitoTV Have you found any solution?

WitoTV commented 7 months ago

@Opisek nope. I have gave up. Nothing I tried worked. And I did not have time and mental strenght to get new one to see if its faulty unit. Are you by any chance having the same issues?

Opisek commented 7 months ago

Yes I am. For now I think I'm giving up on this microcontroller. The documentation is non-existent and I'm not experienced enough in FreeRTOS to try to reverse-engineer or guess how to program this without the Arduino framework. Waste of money.

I've just bought an ESP32-C6, which seems to be exactly what BL616 promised to be, but with the level of documentation and support that's to be expected from Espressif. And wouldn't you know, Zigbee is actually enabled in their SDK as opposed to BL616 :)

Perhaps I'll return to them after I've gathered more experience or Sipeed actually puts any effort whatsoever into their SDKs and documentations. Honestly sad to see them give up a potentially big market like that. The chips seemed great on paper.

mtuxpe commented 7 months ago

I believe that the Sipeed M0S Dock board has some incompatibility related to PSRAM. Using BL616 with the AI Thinker kit (https://docs.ai-thinker.com/en/ai_m62) the GPIO works (not on all pins). I'm still going to test the UART and wi-fi on the ai-thinker. Of course Espressif ESP32-C6 is an option with more documentation and support.