Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to flash FW on Mac OS #47

Closed
trunkafunk opened this issue Apr 17, 2019 · 23 comments
Closed

unable to flash FW on Mac OS #47

trunkafunk opened this issue Apr 17, 2019 · 23 comments

Comments

@trunkafunk
Copy link

I think I have things setup correctly, however I'm not seeing any RFCAT ports enumerated in /dev.

After
sudo rfcat --bootloader --force
I see the 3 lights lit.

BiffRaff:lsusb graypowell$ ls -lrt /dev/ |grep usb
crw-rw-rw- 1 root wheel 18, 14 Apr 17 16:12 tty.usbmodem0000011
crw-rw-rw- 1 root wheel 18, 15 Apr 17 16:15 cu.usbmodem0000011

Now when trying to flash the code I see:
sudo ./rfcat_bootloader /dev/cu.usbmodem0000011 download ../firmware/CCBootloader/CCBootloader-rfcat-ys1.hex
Writing :0600000002017B02140363 RC = 3 (Bad Address)
Error downloading code!

I don't have a JTAG board so I guess I shouldn't be using goodfet to try and flash, correct?

@trunkafunk
Copy link
Author

trunkafunk commented Apr 17, 2019

I've never gotten the RFCAT_BL_YS1 to enumerate.

BiffRaff:firmware graypowell$ make clean installRfCatYS1CCBootloader

==== CLEANING STUFF UP ====
rm -f *.ihx *.rel *.hex *.sym *.asm *.lst *.lnk *.map *.mem *.rst
#./new_serial.py
sdcc -Iinclude -DBUILD_VERSION=../revision.sh -DYARDSTICKONE -DCC1111 -DUSBDEVICE -DUSB_DEVICE_SERIAL_NUMBER="./new_serial.py" -c chipcon_usb.c
[--- new serial number: 0000 ---]
chipcon_usb.c:681: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
chipcon_usb.c:765: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
chipcon_usb.c:1324: warning 230: label without statement
chipcon_usb.c:1302: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
chipcon_usb.c:1302: warning 110: conditional flow changed by optimizer: so said EVELYN the modified DOG
sdcc -Iinclude -DBUILD_VERSION=../revision.sh -DYARDSTICKONE -DCC1111 -DUSBDEVICE -c chipcon_usbdebug.c
sdcc -Iinclude -DBUILD_VERSION=../revision.sh -DYARDSTICKONE -DCC1111 -DUSBDEVICE -c chipcon_dma.c
sdcc -Iinclude -DBUILD_VERSION=../revision.sh -DYARDSTICKONE -DCC1111 -DUSBDEVICE -c bootloader.c
sdcc -Iinclude -DBUILD_VERSION=../revision.sh -DYARDSTICKONE -DCC1111 -DUSBDEVICE -c cc1111rf.c
sdcc -Iinclude -DBUILD_VERSION=../revision.sh -DYARDSTICKONE -DCC1111 -DUSBDEVICE -c global.c
global.c:36: warning 94: comparison is always true due to limited range of data type
global.c:56: warning 126: unreachable code
global.c:57: warning 126: unreachable code
global.c:57: warning 126: unreachable code
sdcc -Iinclude -DBUILD_VERSION=../revision.sh -DYARDSTICKONE -DCC1111 -DUSBDEVICE -c cc1111_aes.c

==RfCatYS1CCBootloader.hex building==
sdcc -Iinclude -DBUILD_VERSION=../revision.sh --xram-loc 0xF000 --code-loc 0x1400 appFHSSNIC.c chipcon_usb.rel chipcon_usbdebug.rel chipcon_dma.rel bootloader.rel cc1111rf.rel global.rel cc1111_aes.rel -DYARDSTICKONE -DCC1111 -DUSBDEVICE
packihx <appFHSSNIC.ihx >bins/RfCatYS1CCBootloader.hex
packihx: read 627 lines, wrote 1205: OK.
if [ ! -c /dev/RFCAT_BL_YS1 ] ; then ../rfcat --bootloader --force && sleep 1 ; fi ;
Entering RfCat Bootloader mode, ready for new image...
Error in resetup():Exception('No Dongle Found. Please insert a RFCAT dongle.',)
Error in resetup():Exception('No Dongle Found. Please insert a RFCAT dongle.',)
Error in resetup():Exception('No Dongle Found. Please insert a RFCAT dongle.',)
Error in resetup():Exception('No Dongle Found. Please insert a RFCAT dongle.',)
Error in resetup():Exception('No Dongle Found. Please insert a RFCAT dongle.',)
Error in resetup():Exception('No Dongle Found. Please insert a RFCAT dongle.',)
Error in resetup():Exception('No Dongle Found. Please insert a RFCAT dongle.',)
rfcat_bootloader /dev/RFCAT_BL_YS1 erase_all

Something is talking to the RfCat dongle (Modem Manager, most likely). Retrying again after 5 seconds. This can take a minute, please be patient.

Here's previous output for getinfo:

print(d.reprRadioConfig())
== Hardware ==
Dongle: YARDSTICKONE
Firmware rev: 0348
Compiler: Not found! Update needed!
Bootloader: CC-Bootloader

== Software ==
rflib rev: 542

== Frequency Configuration ==
Frequency: 901999877.929688 hz (0x259555)
Channel: 0
Intermediate freq: 281250 hz
Frequency Offset: 0 +/-
Est. Freq Offset: 226

== Modem Configuration ==
Modulation: 2FSK
DRate: 38360.595703 hz
ChanBW: 93750.000000 hz
DEVIATION: 20507.812500 hz
Sync Mode: 15 of 16 bits must match
Min TX Preamble: 4 bytes
Chan Spacing: 199951.171875 hz
BSLimit: No data rate offset compensation performed
DC Filter: enabled
Manchester Encoding: disabled
Fwd Err Correct: disabled

== Packet Configuration ==
Sync Word: 0x0C4E
Packet Length: 255
Length Config: Fixed Packet Mode
Configured Address: 0x0
Preamble Quality Threshold: 4 * 2
Append Status: No
Rcvd Packet Check: No address check
Data Whitening: off
Packet Format: Normal mode
CRC: disabled

== AES Crypto Configuration ==
AES Mode: CBC - Cipher Block Chaining
Crypt RF Input: off
Crypt RF Output: off

== Radio Test Signal Configuration ==
TEST2: 0x88
TEST1: 0x31
TEST0: 0x9
VCO_SEL_CAL_EN: 0x0

== Radio State ==
MARCSTATE: MARC_STATE_RX (d)
DONGLE RESPONDING: mode :d, last error# 1

== Client State ==

 client thread cycles:      61/14
 client errored cycles:     0
 recv_queue:                (0 bytes) ''
 trash:                     (3 blobs) "[128, 142, (1555539398.869655, '')]"
 recv_mbox                  (2 keys)  "['0x42', '0xff']"
   app 0x42 (2 records)
         [0x1]    (1 frames)  "[('B\x01\xff\x00\x0f\x85:\x8f,x/\xd3\xf9N\xf03[\xbf\xfa\x07\xfao\xa6\xf6\x9a@\x9bc\x"
         [0x7]    (0 frames)  "[]"

   app 0xff (4 records)
         [0x88]    (0 frames)  "[]"
         [0x80]    (0 frames)  "[]"
         [0x82]    (0 frames)  "[]"
         [0x86]    (0 frames)  "[]"

BiffRaff:CC-Bootloader graypowell$ ./rfcat_bootloader /dev/ttys000 download ../firmware/CCBootloader/CCBootloader-rfcat-ys1.hex

Something is talking to the RfCat dongle (Modem Manager, most likely). Retrying again after 5 seconds. This can take a minute, please be patient.

@trunkafunk
Copy link
Author

Just tried this on an ubuntu install and I'm still getting the bad address issue.

@atlas0fd00m
Copy link
Owner

what does your /etc/udev/rules.d/20-rfcat.rules look like?

@atlas0fd00m
Copy link
Owner

correct, you should be using the bootloader... but the firmware for the bootloader is different than if you flash it directly....

oh, you should be using the firmware you created, not the CCBootloader code.

the firmware you compiled shouljd be <RFCAT_HOME>/firmware/bins/RfCatYS1CCBootloader.hex

@trunkafunk
Copy link
Author

trunkafunk commented Apr 18, 2019 via email

@atlas0fd00m
Copy link
Owner

should only require sdcc to build. you already built it above:
BiffRaff:firmware graypowell$ make clean installRfCatYS1CCBootloader

@atlas0fd00m
Copy link
Owner

it should have already made that file

@trunkafunk
Copy link
Author

trunkafunk commented Apr 18, 2019 via email

@atlas0fd00m
Copy link
Owner

that doesn't look like you flashed a valid RfCat firmware onto the device (unless you snipped out a ton).

what do you get on Linux in syslog when you plug in the device?
lsusb?

@trunkafunk
Copy link
Author

trunkafunk commented Apr 22, 2019 via email

@atlas0fd00m
Copy link
Owner

yes. and that looks like you have a valid RfCat YS1 firmware running.
i need to fix that Modem Manager message. it's only sometimes the problem.

@atlas0fd00m
Copy link
Owner

try pulling the latest client (python) code and using its rfcat_bootloader (easiest way is just to install it, but you can use it in-place if you know what you're doing and want to)

@trunkafunk
Copy link
Author

trunkafunk commented Apr 23, 2019 via email

@trunkafunk
Copy link
Author

trunkafunk commented Apr 23, 2019 via email

@trunkafunk
Copy link
Author

trunkafunk commented Apr 23, 2019 via email

@atlas0fd00m
Copy link
Owner

gray@gray-VirtualBox:~/rfcat/firmware$ rfcat_bootloader /dev/RFCAT2 erase_all

won't work because RFCAT2 indicates that it's not in Bootloader mode. you either have to jumper the pins, or use "rfcat --bootloader --force" to kick it into bootloader mode (this is done automatically during the build/install process from the Makefile).

i'm not sure why the install is failing.
what's the results of:
$ ls -la /dev/RF*

@trunkafunk
Copy link
Author

trunkafunk commented Apr 23, 2019 via email

@atlas0fd00m
Copy link
Owner

yes. @dominicgs @michaelossmann, have any pointers?

@trunkafunk if you have a GoodFET, you may want to try flashing the bootloader and then the new firmware.

$ make installys1bootloader
$ make installRfCatYS1CCBootloader

thanks,
@

@zhoze
Copy link

zhoze commented Feb 12, 2020

How can I use GreatFET instead of GoodFET to flash bootloader and firmware?

@atlas0fd00m
Copy link
Owner

that is a great question, to which i don't currently have the answer. that's better suited for @dominicgs or @michaelossmann

@Commander-Crash
Copy link

This is a nightmare.

@atlas0fd00m
Copy link
Owner

explain the nightmare?

@bigoper
Copy link

bigoper commented Dec 13, 2021

HELP

Following the diff tips on this page and here I got the following:

  • not sure how to continue from here
$ sudo rfcat_bootloader /dev/cu.usbmodem0000011 download firmware/bins/RfCatYS1CCBootloader.hex          
Writing b':0614000002148B024BFCFC' RC = b'0'(OK)
... TRUNCATED ...
... TRUNCATED ...
Writing b':105A9400EC13FCEB13FBEA13FAE913F9D8F12275C2' RC = b'0'(OK)
Writing b':035AA4008200225B' RC = b'0'(OK)
Skipping non data record: 'b':00000001FF''

USB

  • I don't see my device anymore
$ ioreg -p IOUSB                                                                                         
+-o Root  <class IORegistryEntry, id 0x100000100, retain 17>
  +-o AppleUSBXHCI Root Hub Simulation@14000000  <class AppleUSBRootHubDevice, id 0x100000329, registered, matched, active, busy 0 (4 ms), retain 16>
    +-o Apple Internal Keyboard / Trackpad@14400000  <class AppleUSBDevice, id 0x100002227, registered, matched, active, busy 0 (1 ms), retain 18>
    +-o BRCM20702 Hub@14300000  <class AppleUSBDevice, id 0x100002255, registered, matched, active, busy 0 (0 ms), retain 12>
      +-o Bluetooth USB Host Controller@14330000  <class AppleUSBDevice, id 0x100002280, registered, matched, active, busy 0 (0 ms), retain 17>

ISSUE RESOLVED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants