Thread Tools
This thread is privately moderated by silverxxx, who may elect to delete unwanted replies.
Aug 16, 2016, 05:13 PM
Registered User
Thread OP
Discussion

H8 blue board flashing instructions


The h8 blue board has a strange issue when flashed with "Keil", and it needs specific workarounds.

Also, the board pads are mislabeled, the pad marked CLK is actually DAT, and viceversa.

Windows:

This only affects the blue board and the Keil program (windows)

The actual flashing instructions are similar to those for the CG023 and other stm32 based quads, in this thread

An error comes up after the st-link is disconnected from the usb port . This results in a "communication error" popup.

To clear,

1. disconnect the st-link from usb and reconnect

2. Use the st-link utility (mirror) , connect to the board, and then disconnect, using the toolbar buttons or menu items

At this point the board should be flashable again in keil, until the usb is disconnected again.


Alternatives to the st-link utility:
You could also clear the error in other ways:
1: Flash any other non-blue quad using the st-link
2: Run the ST-LinkUpgrade.exe utility present in your keil folder, and upgrade the st-link
3: Use openocd to connect to a board
4: (included in above instructions) Use the st-link utility to connect to a board


Note: the board needs to be powered by a battery while flashing / erasing.

Sorry about this, the bug is beyond my control.


Hex file:
The hex file compiled by keil can be found in the "Objects" folder , h8blue.hex , and can be flashed with st-utility if needed

Linux:
Use instructions in file INSTALL.md . There should not be any issues except that the board pads are mislabelled. Gcc compiles somewhat larger, and as such you may need to turn off some features and watch file size, as the defaults are not always checked to fit compilation by gcc. You can see compilation status at travisCI


Code: (github)

Video of the procedure by gioy808 (rcgroups)

Video by ArbitraryNotion: (rcgroups)

Flashing using the st-utility only (post)

Binary location(use only if you have trouble compiling your own) (github)

Devo telemetry setup: RCG Post
Last edited by silverxxx; Feb 05, 2017 at 06:42 PM.
Sign up now
to remove ads between posts
Aug 22, 2016, 05:50 PM
Registered User
techcoast's Avatar

Blue board but STLink not seen


Okay, so I downloaded the utilities, still no connection between the board and uVision. I'm also not able to connect in the utillity itself. I WAS able to flash the firmware of the ST-Link.. so there IS something there.. I'm at a loss for what to do next.

I did note the connection difference of the SWCLK and the SWDIO.

Thanks.
Aug 22, 2016, 06:07 PM
Registered User
Thread OP
Are you powering the board using a battery? Did you run a ground wire as well? And the SWCLK and the SWDIO are swapped around, just double-checking, so you need to connect SWCLK to DAT on the board, and viceversa.
Aug 22, 2016, 06:16 PM
Registered User
techcoast's Avatar
Ground to ground,
DAT to SWCLK
CLK to SWDIO

That should take care of the reversing if I'm not mistaken.

And I've tried it with and without the battery.

OKay, so slightly new thing happend. using the link utility, I connected the battery and this time I got up through the device family prompted and then errors out iwth
Can not read memory!
Disable Read Out Protection and retry

Still can't see device in uVision, under Target Driver Setup, Debug tab
SWDIO - ST-LINK connection error
Last edited by techcoast; Aug 22, 2016 at 06:22 PM.
Aug 22, 2016, 07:02 PM
Registered User
Thread OP
After the connection error you need to connect to the board using the st-utility, then erase the board in keil.

Connecting to the board using the utility will clear the " ST-LINK connection error " as otherwise it won't go away, so you need to do that everytime it comes up.

It comes up with "Disable Read Out Protection and retry" because it still has the factory firmware.

So once yo clear the error, you need to
1) erase the chip in keil
2) power cycle the board
3) build the code (click build button)
3) flash the new firmware (button with 2 arrows)

no need for other steps really, don't worry about the target and stuff.
Aug 22, 2016, 07:10 PM
Registered User
techcoast's Avatar
So, I'm not sure where to go to "erase" the board in uVision. I started by going to flash and erase, but then I get an error
ST-LINK connection error.

This, after I disconnected the USB, reconnected, connected via the Utility (all while power is on for the H8)
Aug 22, 2016, 07:12 PM
Registered User
techcoast's Avatar

re: Utility fail


Here's some captures
Aug 22, 2016, 07:18 PM
Registered User
Thread OP
try disconencting / reconencting the st-link from usb.

The stlink utility is working, the "error" is just information that the firmware is still locked. You could erase the chip by using the relevant menu option in the utility itself, for example.

Note the doing that will erase the factory firmware, so the board will be unusable until you upload a new code.

Also, don't change things in the st-link menus as some can break the board (permanently). Actually there is only one way, but it does exist.
Aug 22, 2016, 07:22 PM
Registered User
techcoast's Avatar
I tried to erase it in the Utility, just keeps telling me that the protection is there..
Aug 22, 2016, 07:30 PM
Registered User
techcoast's Avatar

Option Bytes


Is there something I'm just not understanding in these settings that would remove the protection?
Aug 22, 2016, 07:57 PM
Registered User
Thread OP
Set protection to "level 0", that will remove it

Do not set to level 2 as that can't be undone

But keil should be able to erase it if the utility connects, have you tried restarting it / computer?
Aug 22, 2016, 07:58 PM
Registered User
techcoast's Avatar
BINGO! Set to level 0 worked!!
Aug 22, 2016, 07:59 PM
Registered User
techcoast's Avatar
moving on to next step!! Thank you!!
Aug 22, 2016, 08:03 PM
Registered User
techcoast's Avatar
Sorry, any suggestions where to find the "program" for the STLink?? /bin hex etcc
Aug 22, 2016, 08:26 PM
Registered User
techcoast's Avatar
I'm still not able to read the STLink in uVision..


Quick Reply
Message:
Thread Tools