bouffalolab / bouffalo_sdk

BouffaloSDK is the IOT and MCU software development kit provided by the Bouffalo Lab Team, supports all the series of Bouffalo chips. Also it is the combination of bl_mcu_sdk and bl_iot_sdk
Apache License 2.0
349 stars 121 forks source link

BL808 running problem #63

Open elektro-NIK opened 1 year ago

elektro-NIK commented 1 year ago

Hello! I have a Pine64's Ox64 board (with 2MB flash) and I don't run helloworld app.

I have:

What I do:

I don't have JTAG adapter for debug MCU startup yet. Maybe I make some stupid mistake and someone shows me this?

gamelaster commented 1 year ago

Hi @elektro-NIK , this is due Flash memory misconfiguration.

Try this: https://github.com/bouffalolab/bl_mcu_sdk/issues/32#issuecomment-1345646038

elektro-NIK commented 1 year ago

@gamelaster I try your instruction, but my board still not work.

cat $HOME/.local/lib/python3.10/site-packages/bflb_mcu_tool/utils/flash/bl808/flashcfg_list.csv | grep ef6015

ef6015,W25Q64JW_ef6017.conf

cat $HOME/.local/lib/python3.10/site-packages/bflb_mcu_tool/chips/bl808/eflash_loader/eflash_loader_cfg.ini | grep -A 4 FLASH_CFG

[FLASH_CFG] flash_id = ef6015

bit 7-4 flash_clock_type: 0:120M wifipll, 1:xtal, 2:128M cpupll, 3:80M wifipll, 4:bclk, 5:96M wifipll

bit 3-0 flash_clock_div

flash_clock_cfg = 0x43

I see on Pine64 wiki page are wrong datasheets for flash chips: GigaDevice instead of Winbond on the board. I will try to edit this page.

gamelaster commented 1 year ago

Hmm, that's weird. Can you please take a picture of SPI Flash chip? Thanks

elektro-NIK commented 1 year ago

PXL_20230117_051659823

NilsBe commented 1 year ago

I have managed to compile and flash the Hello World example on the 16MB version but it didn't work on the 2MB version. Do you have the 16MB version available to test that one?

elektro-NIK commented 1 year ago

Yep, I have the same behavior. All works on 16MB and not works on 2MB board.

gamelaster commented 1 year ago

I'm working on it. It is 100% issue with flash configuration, because BootROM can both read and write to SPI Flash. Only when the firmware is executed, the special configuration is used to use higher speed clocks and flash related modes to have higher transfer speeds, and this is not properly configured, so flash don't work at all.