Fun, Learning, Friendship and Mutual Respect START  HERE


Unregistered
Go Back   HeliFreak > R/C Helicopter Support > Blade Helicopters (eFlite) > mCP X Brushless Mods


mCP X Brushless Mods Blade Micro CPx Brushless Mods and Conversions


Reply
 
LinkBack Thread Tools Display Modes
Old 01-14-2020, 03:29 PM   #1 (permalink)
Registered Users
 

Join Date: Jan 2020
Location: New Zealand
Default Using owSilProg on a blank mcu?

Hi, I've been designing my own ESC from scratch as a project, and decided to go with the EFM8BB1 chip for the processor. That means I can make use of the wonderful owSilProg to program it with arduino. However, I'm struggling having read through the instructions carefully and rechecked all my wiring a number of times, and even reading through the 20 page thread of others problems, and I believe my problem is a bit unique.

See, I don't have ANY firmware existing on my ESC's mcu yet, as the manufacturer only ships the chips with a bootloader pre-flashed. When I connect an Arduino Uno with owSilProg to the chip CSCK and C2D + GND, and power the chip pins directly with +3.3V, I get the classic "dů Connection to target FAILED!" error.

Now I know what you are going to say, but believe me I have checked my wiring and pinouts in every imaginable way a total of more than 10 times over. I spent hours checking it and even trying random permutations of connections at times. But now I'm completely confident the CSCK and C2D lines are wired correctly.

In fact, here's the interesting part: I've now moved to the bray terminal to better diagnose the problem and found this:

when I send "d" I get a response back: ">dokFF". Interesting, it looks like the other responses but has FF appended. My guess is that BLHeliTool interprets this as an error, not success. And thus I am unable to get any further. Is it possible to have BLHeliTool flash/verify work with blank EFM8BB1? I suspect the FF returned is simply from whatever the factory has flashed and isn't any kind of recognisable ESC header, but I can't see the BLHeliTool code so this is only a guess, and this is where I need help. Any insights?

My programmer setup:
rocifier is offline        Reply With Quote Quick reply to this message
Sponsored Links
Advertisement
 
Old 01-14-2020, 11:51 PM   #2 (permalink)
Registered Users
Thread Starter Thread Starter
 

Join Date: Jan 2020
Location: New Zealand
Default

Sorry about the large image, I'm not sure how to shrink it down in this forum?

On my custom board: 100% Green = GND, Yellow = C2CK, Orange = C2D
rocifier is offline        Reply With Quote Quick reply to this message
Old 01-15-2020, 03:40 AM   #3 (permalink)
Registered Users
Thread Starter Thread Starter
 

Join Date: Jan 2020
Location: New Zealand
Default Found a workaround

Well, I finally found a workaround. It seems that BLHeliTool doesn't support device code FF which is my EFM8BB1. Yet my MCU uses the same C2 interface as the other processors (eg. the supported F330). So I wrote a powershell script to flash my blank chips, as I don't know if BLHeliTool is still in development these days.

Hope my script might be useful for someone else to flash arbitrary .hex files via an owSilProg arduino. Note: it basically skips the "d" device id check, so assumes you know what you're doing a bit. Save the below code into flash.hex and run it in powershell (now cross-platform) with the hex file as a command line parameter:
.\flash.hex hex_filename

Code:
param (
    [Parameter(Mandatory=$true)][string]$hex_filename
)

$port = new-Object System.IO.Ports.SerialPort COM5,38400,None,8,one
$port.Close()
$port.Open()

$port.Write("v")
Write-Output $port.ReadLine()

$port.Write("r")
Write-Output $port.ReadLine()

$port.Write("i")
Write-Output $port.ReadLine()

$hex_lines = Get-Content -Path $hex_filename
$hex_lines | ForEach-Object {
    if($_ -eq ":00000001FF") { break; }
    $port.WriteLine("bw" + $_);
    Write-Output($port.ReadLine());
    $port.DiscardInBuffer()
}

$port.Close()
rocifier is offline        Reply With Quote Quick reply to this message
Reply




Quick Reply
Message:
Options

Register Now

In order to be able to post messages on the HeliFreak forums, you must first register.
Please enter your desired user name, your REAL and WORKING email address and other required details in the form below.
User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.
Password:
Confirm Password:
Email Address
Please enter a valid email address for yourself. Use a real email address or you will not be granted access to the site. Thank you.
Email Address:
Location
Where do you live? ie: Country, State, City or General Geographic Location please.
Name and Lastname
Enter name and last name here. (This information is not shown to the general public. Optional)
Helicopter #1
Enter Helicopter #1 type and equipment.
Helicopter #2
Enter Helicopter #2 type and equipment.
Helicopter #3
Enter Helicopter #3 type and equipment.
Helicopter #4
Enter Helicopter #4 type and equipment.

Log-in


Thread Tools
Display Modes

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Copyright © Website Acquisitions Inc. All rights reserved.
vBulletin Security provided by vBSecurity v2.2.2 (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.

SEO by vBSEO 3.6.1