NunchukRF flashing problems...

Discuss hardware related to the VESC such as the NRF nunchuk.
Quezacotl
Posts: 24
Joined: 05 Apr 2017, 11:06
Location: Finland

NunchukRF flashing problems...

Postby Quezacotl » 24 May 2017, 10:05

Hello!

I have problems with flashing the stm32f100c8t6 firmware.

I'm talking about this thing:
Firmware: https://github.com/vedderb/nunchuk_mod
Hardware: https://github.com/vedderb/nunchuk_rf_hw

When i'm trying to upload the firmware (make upload), it seems that it gets the connection, but then this error appears:

Code: Select all

stm32flash /dev/ttyUSB0 -i -rts,dtr,-dtr:rts,dtr,-dtr -b 1000000 -w "build/nunchuk_rf.bin" -v -g 0x0
stm32flash 0.5

http://stm32flash.sourceforge.net/

Using Parser : Raw BINARY
Interface serial_posix: 1000000 8E
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0420 (STM32F10xxx Medium-density VL)
- RAM        : 8KiB  (512b reserved by bootloader)
- Flash      : 128KiB (size first sector: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory
Got NACK from device on command 0x43
Can't initiate chip mass erase!
Failed to erase memory


When i try to remove protection(if it even has one), it says this:

Code: Select all

stm32flash /dev/ttyUSB0 -i -rts,dtr,-dtr:rts,dtr,-dtr -b 1000000 -k
stm32flash 0.5

http://stm32flash.sourceforge.net/

Interface serial_posix: 1000000 8E
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0420 (STM32F10xxx Medium-density VL)
- RAM        : 8KiB  (512b reserved by bootloader)
- Flash      : 128KiB (size first sector: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Read-UnProtecting flash
Failed to read ACK byte


Any thing i might be missing?


Here's a picture of the thing. The USB bridge was a bitch to solder, but appears that it's working.
Those missing legs are missing because it's easier to solder with unneeded pins.
Attachments
img_20170524_125716_34475368730_o.jpg
img_20170524_125716_34475368730_o.jpg (406.43 KiB) Viewed 844 times

rew
Posts: 905
Joined: 25 Mar 2016, 12:29
Location: Delft, Netherlands.

Re: NunchukRF flashing problems...

Postby rew » 25 May 2017, 04:24

Quezacotl wrote:Any thing i might be missing?
Well. You seem to be missing some pins on the chip. :-) But you knew that....

Quezacotl
Posts: 24
Joined: 05 Apr 2017, 11:06
Location: Finland

Re: NunchukRF flashing problems...

Postby Quezacotl » 25 May 2017, 13:27

Now i got so far that i got write and read-protections disabled. Atleast it says "Done" and no errors.
But now the error while trying to write the firmware is:

Code: Select all

Failed to read ACK byte
Failed to write memory at address 0x08000000


And that happened when i heated the device with hot air gun.
So i'll just make another device, and see what will happen.

EDIT: Woohoo! I made another, and it started working!

Code: Select all

stm32flash /dev/ttyUSB0 -i -rts,dtr,-dtr:rts,dtr,-dtr -b 1000000 -w "build/nunchuk_rf.bin" -v -g 0x0
stm32flash 0.5

http://stm32flash.sourceforge.net/

Using Parser : Raw BINARY
Interface serial_posix: 1000000 8E
Version      : 0x22
Option 1     : 0x00
Option 2     : 0x00
Device ID    : 0x0420 (STM32F10xxx Medium-density VL)
- RAM        : 8KiB  (512b reserved by bootloader)
- Flash      : 128KiB (size first sector: 4x1024)
- Option RAM : 16b
- System RAM : 2KiB
Write to memory
Erasing memory
Wrote and verified address 0x08004c34 (100.00%) Done.

Starting execution at address 0x08000000... done.


All i now need is the nrf-module and a charger-chip. Can't wait to arrive :D

Quezacotl
Posts: 24
Joined: 05 Apr 2017, 11:06
Location: Finland

Re: NunchukRF flashing problems...

Postby Quezacotl » 30 May 2017, 10:50

Okay, now i have built the whole PCB and soldered the Z and C-buttons also.

When i flash it, the all LEDs lit. When i pull it out of the USB and put back, only the blue is on. That seems normal so far.
But when i put it on battery or USB, no matter what i do, i can't get any LEDs on except the blue when on USB. Pressing C and/or Z does nothing.

I checked all with continuity test, and everything seems to be connected. Now it seems to be software problem. But where to look at?
I have all address resistors populated, whick means address 15, according to some other forum thread.

Is there any official guide for this? I can't seem to find anything, not even how the address resistors go.

EDIT: Strange. When i connect it to computer, start virtualbox(Windows 7), connect the device, then the leds start to work. Blue activates briefly when i hit any button or joystick, and other two blink randomly.

So now when i connected the battery, then connected it to Windows7, and disconnected from computer, it seems that it is functioning; no light -> press Z&C -> red lights, then goes off.
That seems so far to be best i can get out of it. It still can't connect to VESC though. As i understand, it should stay red, and it would be good to go.
But it should'nt work like that i need to connect it to Windows first..

I did the settings like in this thread: viewtopic.php?f=15&t=75

There is too much unsure variables. Could anyone list the facts that what must be how to things to work?

Quezacotl
Posts: 24
Joined: 05 Apr 2017, 11:06
Location: Finland

Re: NunchukRF flashing problems...

Postby Quezacotl » 30 May 2017, 17:08

Okay... Strange...

I Googled into a german site: http://www.elektro-skateboard.de/forum/ ... f-5092.php

I tried that firmware that was there, and suddenly it worked! Although i needed to "activate" the device by plugging it into Windows7. What is the thing with that??

It was this command: stm32flash /dev/ttyUSB0 -i -rts,dtr,-dtr:rts,dtr,-dtr -b 1000000 -w ws2812_rf.hex -v -g 0x0
I tried to upload the official code with same command, but didn't change anything.

Quezacotl
Posts: 24
Joined: 05 Apr 2017, 11:06
Location: Finland

Re: NunchukRF flashing problems...

Postby Quezacotl » 18 Jun 2017, 20:43

I have had problems with the nunchuk. It dies randomly, and usually awakens when i connect it to Windows.
Now when i changed the battery and i got short on 3V3 regulator VCC and GND pins, the regulator got broken. I replaced the regulator. But now when i try to connect, it just flashes the green led, and doesn't connect.
Firmware upload still works.
And when i connect to Windows, the red LED flashes, and when i press "connect" on BLDC Tool, the red LED stays as long as it tries to connect.

Is there anywhere any info what all LED status mean?
I also saw some voltage-related info with LEDs on the source code, but i know almost nothing about coding...

In the meantime, i might as well make another nunchuk as spare, and to see how it behaves..

EDIT: Now i made a new one. It works exactly like the previous. But now i noticed that i don't need the Windows afterall. All the nunchuk needs to activate is something that tries to talk to it. BLDC Tool connection attempt was enough to activate it.

But i have still the problem. The default firmware is not able to connect to VESC, while this mysterious germany-edition can.
I need to ride tomorrow a test ride and see how this new nunchuk performs.


Return to “Related Hardware”

Who is online

Users browsing this forum: No registered users and 1 guest