I can access the bootloader with xctu but where is the xmodem tab?

Hi,

I compiled a “training program” with codewarrior in release version.

After that, I want to load it in the application space of my programmable xbee with the help of the integrated bootloader.

I want to send this program by using the grove board with xctu. Is it possible at all?

I can make the device entering the bootloader menu but that is the final thing I can do following the 10.6.1. Transfer process chapter from the codewarrior help. After that it tells to select the xmodem menu but… In my version of xctu (the newest I suppose) there is no xmodem menu!

How can I make it working?

Thanks!

Yeah, XModem is currently only present in legacy XCTU 5.2.8.6

You can download it from this link:
http://ftp1.digi.com/support/utilities/40003002_C.exe

1 Like

Hello,

Yes it is possible… With help of a second software. The steps to follow :

There will be a step where it is important to go fast. For this, install tera term and connect to your xbee board with the right baud rate and control bits by selecting in the menu : Setup->Serial Port…

  1. Compile your software with the codeWarrior suite (Release version, not Debug)
  2. In tera term, after connected to your device, click File->Transfer->XMODEM->Send… and navigate to your project directory “Workspace->project folder->Release” and open any file, this will just set the current folder for the next time, when you will make the “real transfer”, because the bootloader don’t let you so much time to begin the application download and to navigate in your folders…
  3. Clic File->disconnect to allow the connection with xctu
  4. Open XCTU to start the bootloader mode on your board. For this :
  5. Connect your computer to your device using the “+” button
  6. In the menu, select : tools->serial console
  7. Clic “Open” and check the radio buttons like this : DTR=1 RTS=0 BRK=1
  8. Reset the xbee pressing the reset button on the grove board
  9. toggle the button brk (off)
  10. Close xctu and connect to your xbee with the tera term software
  11. Press “f” on your keyboard and now, go fast for the final step :
  12. click File->Transfer->XMODEM->Send… and select the “yourprojapp.abs.bin” file

That’s it!

Absolutely deplorable that Digi doesn’t supply a tool for flashing the programmable XBee. What? They think in a production environment we are going to let assembly personnel fire up CodeWarrior and bit bang 50000 XBees? Digi! Pull your head out!

Fortunately, XMODEM is a reasonably simple protocol and IggMoe has published a fine bit of C# code for it on the GHIElectronics Community website. Web search for “XMODEM_FullDotNET site:ghielectronics.com”. You can embed his C# code in the following PowerShell wrapper and you are good to go:

$Source = @"

"@
Add-Type -TypeDefinition $Source -Language CSharp
$myCom = [System.IO.Ports.SerialPort]::GetPortNames()[0]
#$Port = New-Object System.IO.Ports.SerialPort($myCom,115200,‘None’,8,1)
$XModem = New-Object XbeeXmodemNS.XMODEM_FullDotNET( $myCom,‘XModemCRC’)

$Port = $XModem.Port
$Port.BaudRate = 115200
$Port.Parity = ‘None’
$Port.DataBits = 8
$Port.StopBits =1
$Port.ReadTimeout = 100
$Port.WriteTimeout = 100
$Port.Open()
$Port.RtsEnable = $false
$Port.DtrEnable = $true
$Port.BreakState = $true
$cr = Read-Host “Reset target and press Return”

Clear break (takes a few seconds)

$Port.BreakState = $false
Start-Sleep -Seconds 3

Send return

$Port.WriteLine(‘’)
for ($i=1;$i -lt 10;$i++) {
if ( $Port.BytesToRead -gt 0 ) { $Port.ReadExisting();}
Start-Sleep -Milliseconds 50;
}

Send ‘F’ wait for ‘C’

$Port.Write(‘F’)
for ($i=1;$i -lt 10;$i++) {
if ( $Port.BytesToRead -gt 0 ) {
$C = $Port.ReadExisting();
}
if ($C = ‘C’) {
break;
}
Start-Sleep -Milliseconds 50;
}

Load and send the file

$Filename = ‘D:\Work\XbeeXmodem\WMLCv6.5.abs.bin’
$Data = [System.IO.File]::ReadAllBytes($Filename)
Write-Host "Starting XMODEM, sending " $Data.LongLength “bytes”
$BytesSent = $XModem.Send($Data);
if ($BytesSent -eq $Data.LongLength) {
Write-Host “File was successfully sent.”
} else {
Write-Host “Error!! File upload failed!”
}

$Port.Close()

1 Like

The manual steps to get the module into a bootloader and to flash via the legacy XCTU Xmodem got me to the point where I just wrote a handy tool for myself (and others if interested).

A tool I use in MacOS but should work everywhere where Node.js works: https://github.com/exsilium/pxbee-fwup.js

Example use: https://asciinema.org/a/2BP9maFqVWEz2MdN37sb73KE4

Would be good to get some feedback also from Windows folks.