Wiz-IO / platform-quectel

Quectel development platform for PlatformIO
97 stars 42 forks source link

BC26 module cannot upload @ linux VScode #4

Closed Senrecon closed 5 years ago

Senrecon commented 5 years ago

Some upload openCPU BC26 flash error:

Short press Auto-detected: /dev/ttyUSB0 Uploading: program Wait for Power ON or Reset module <.........................................> DONE Starting <.......... ERROR: DA 1 status *** [upload] Explicit exit, status 2 ===================================== [ERROR] Took 5.91 seconds ===================================== The terminal process terminated with exit code: 1

Long Press Auto-detected: /dev/ttyUSB0 Uploading: program Wait for Power ON or Reset module <..................> DONE Starting <.................................................................................................................... ERROR: baudrate CONF *** [upload] Explicit exit, status 2 ===================================== [ERROR] Took 1.64 seconds ===================================== The terminal process terminated with exit code: 1

I m not use BC66-TE-B, I used another board.

I'm trying to change the repeat time of

def da_start(self, nvdm = False): from 50 to 500, it still failed to upload.

When I use windows MTK IOT Flashtool.exe, following the guidance, it succ to upload.

http://doc.iotxx.com/NB-QuickStarter%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E%E4%B9%A6

Carrirer board system diagram like below: http://doc.iotxx.com/%E6%96%87%E4%BB%B6:%E5%8A%9F%E8%83%BD%E6%A1%86%E5%9B%BE-NBQS.png

Core Board system diagram like below: http://doc.iotxx.com/NB260%E7%A1%AC%E4%BB%B6%E8%AE%BE%E8%AE%A1%E6%89%8B%E5%86%8C#/media/File:%E5%8A%9F%E8%83%BD%E6%A1%86%E5%9B%BE-NB260.png

The SDK is BC26_OpenCPU_SDK_BETA0801 SDK bin file: BC26NBR01A03 which launched at Aug 2018.

Wiz-IO commented 5 years ago

for Linux maybe need drivers https://www.maxlinear.com/product/interface/uarts/usb-uarts/xr21v1412

If Flashtool.exe can comunicate you can load cfg/bin from project folder ....PROJECT.pioenvs\bc66\program.cfg

For BC26 work only OpenCPU for now For Arduino you need BC66

Senrecon commented 5 years ago

Did you mean the linux auto-installed driver cannot work?

I worked at OpenCPU on BC26 now.

Wiz-IO commented 5 years ago

I have questions from others that there is a problem with the driver under Linux For now use Windows... later I will test all under linux

Senrecon commented 5 years ago

Thanks ! I will try to update CH340 USB2Uart driver @ linux, to see if it can work? will update this issue later.

Wiz-IO commented 5 years ago

ok, test please if you have BC26 firmware with DBG folder, please send me to make port for arduino

Senrecon commented 5 years ago

Still cannot upload and blocked at Baudrate error.

I used following CH34x

https://github.com/juliagoda/CH341SER

Senrecon commented 5 years ago

I only got OpenCPU firmware, no Dbug folder I think.

the download link: https://pan.baidu.com/s/1OF3uIphvs3vrMHy2AHxREQ#list/path=%2Fsharelink1824053184-636263183088586%2FNB260%2FOpenCPU_SDK&parentPath=%2Fsharelink1824053184-636263183088586

Wiz-IO commented 5 years ago

Are you sure you PowerON/Reset the module on boot if module is ON need reset key, if is OFF need PWRKEY

Senrecon commented 5 years ago

On my board, PowerOn/Reset control by a jumper.I used PowerKey, on normal status, the powerkey will short to ground, when push the button, it will be 3.3v connected.

I'm not sure your point, at windows enviroment, it works normal. at Linux, the debug info can be show at vscode terminal, but download always failed.

Wiz-IO commented 5 years ago

try on Linux AT commands

Senrecon commented 5 years ago

I will try tomorrow, thanks

Senrecon commented 5 years ago

I shift to win vscode + platformio, it works normal. I think this linux upload issue maybe not complicate, if follow MT2625 upload procedure(Document is better), root should be dig out. need check feedback bytes when set baudrate 921600. If you have document , would you please share with me, I will check it.

below is the win upload Checking size .pioenvs\bc26\program.elf Memory Usage -> http://bit.ly/pio-memory-usage DATA: [= ] 5.4% (used 5449 bytes from 100000 bytes) PROGRAM: [ ] 0.6% (used 1120 bytes from 200000 bytes) Configuring upload protocol... Looking for upload port... Auto-detected: COM7 Uploading: program Wait for Power ON or Reset module <.......................> DONE Starting <.........................................................> DONE Uploading <.....................................> DONE

Wiz-IO commented 5 years ago

https://github.com/Wiz-IO/platform-quectel/blob/master/builder/frameworks/pyMT2625.py#L285

I have not Mediatek documents... reverse engineering

Senrecon commented 5 years ago

That's not easy, I just checked codes,and modified some print out to debug I found

  1. the baudrate didnot rise up to 921600(at module side), just keep 115200
  2. write CONF 0x69, get feedback 0x6D

I cannot tell what happened inside the module. I have no idea to debug more. following codes doesnot work. self.write(ACK, 2) # Latch power key done, Enable charger detection error code
self.write(ACK + b"\x00", 2) # disableLongPressPowerKey
self.write(ACK, 2) # long-press shutdown by power key setting done
self.s.write(ACK+ACK) # Raise MCU Speed done

Wiz-IO commented 5 years ago

if work for you - skip rice the baudrate

Senrecon commented 5 years ago

It cannot work. I need convert to win dev environment.

DurandA commented 5 years ago

For BC26 work only OpenCPU for now For Arduino you need BC66

I confirm that you can flash BC26 with BC66 firmware!