-
Notifications
You must be signed in to change notification settings - Fork 78
05. Uploading Firmware
Warning
Note
This is the method we recommend using for loading firmware to the RP2040, the .UF2 files for RP2040 can be found on the repository. For the SAMD21 you can create an .UF2 file out of any of the available .ino programs, but we recommend just using the Arduino IDE.
-
Connect the board to the computer
-
Locate the desired firmware in the repository and save it locally. (make sure it is the correct version for your board)
-
Open the file location on the file explorer
-
Double tap the Reset0 button on the board to put the RP2040 in bootloader mode
-
A file explorer window will open for your board
-
Drag and drop the .UF2 file into the file explorer window for the board
-
If the correct version was copied, the window should close automatically, if not close it manually and check for the correct firmware
-
Reset your board
Drag and Drop Firmware
Arduino IDE for SAMD21
Important
This is the method we recommend using for loading firmware to the SAMD21, the .ino files can be found on the repository and can be uploaded using the Arduino IDE using Electronic Cats SAMD Arduino Core. Using the Arduino IDE with the RP2040 is possible directly via USB with the Arduino Mbed RP2040 Core, it is important to acknowledge one bug inside the Arduino Core for the RP2040, and it's mandatory to change one line of code inside the core. Firmware can also be uploaded to the SAM21 using a .UF2 file, the files will also be available on the repository.
The Arduino Integrated Development Environment – or Arduino Software (IDE) – contains a text editor for writing code, a message area, a text console, a toolbar with buttons for standard functions, and a series of menus. It connects to different boards to upload programs and communicate with them.
You need to download and install Arduino IDE; you can find it here.
After installing Arduino IDE, open it, and you will see the following window.
Arduino IDE Main View
The next step to use our boards is to install the board’s core in the Arduino IDE. Here is a quick guide on how to install them:
You must install the latest Arduino SAMD core.
- In the menu bar, select
Tools > Boards > Board Manager
.
Board Manager Menu
- A side window will open and in the search bar, write SAMD, a list of cores will appear, click on the install button for Arduino SAMD Boards (32-bits ARM Cortex-Mo+).
Board Manager
- Installing the Electronic Cats SAMD Arduino Core: https://electroniccats.github.io/Arduino_Boards_Index/package_electroniccats_index.json
Arduino allows us to add custom cores or support for non-Arduino boards using the board manager. To do this we need to add a URL on the board manager configuration. Go to File>Preferences>Additional boards manager URLs
.
Preferences Menu
Preferences
- If you already have a URL in the space there, you can click the button to the left, jump to another line and paste the Electronic Cats URL there. https://electroniccats.github.io/Arduino_Boards_Index/package_electroniccats_index.json
Additional Boards Manager URLs Window
- Press the "OK" button.
- Open the "Boards Manager" that is in
Tools > Board > Board Manager
. - Now write Electronic Cats in the search bar.
- Click on install, wait for the installation to finish, and close the window.
- In
Tools > Boards
, scroll down in the board list until you see the Electronic Cats SAMD boards.
ElectronicCats Boards Installed
After downloading the core, you can upload the .ino
files from the repository like you would do for any other board using the Arduino IDE.
Important
It is really important to correctly identify the type of CC1352 chip that your board has. Loading the incorrect firmware to your board may get it stuck and it will not allow you to reprogram it by bootloader. Identifying which type of board you have is really simple, just hold your board up on a well lit space and read the inscription on the chip marked in the photos below. If you are not able to read the chip you can shine a flashlight or camera flash onto the board to be able to read it better. We also recommend using a magnifying glass or taking a close up picture with the camera flash on of the chip. If your board is a v3.x the chip should be a CC1352P7.The real issue is with v1.x and v2.x boards. This version can have either a CC1352P1 or a CC1352R1. If you flash either chip with the incorrect firmware you risk bricking your board and it will only be possible to recover using an external cJTAG programmer.
This script works to upload firmware from the releases page to the CatSniffer Board V3.x.
Important
The current version of the Catnip requires the lasted version of the SerialPassthroughwithboot-(v1.1)
The struct files from the repo is:
.catnip-uploader:
├── catnip_uploader.py
├── cc2538.py
├── releases.json
└── requirements.txt
To initialize first we need to install all the requiered packets.
Note
We recommend use virtual environment to avoid dependencies errors.
To install the requirements run the next command: pip install .
Requirements packets:
typer==0.9.0
pyserial==3.5
requests==2.31.0
intelhex==2.3.0
python-magic==0.4.27
If you are working on Linux his will also setup the the tool so it is useable from anywhere on the enviorment, removing the need to be on the tool's route.
To check available commands we can use the command python catnip_uploader.py --help
from a terminal on the folder containing the tool.
To check the list of firmwares available to load to the board we can use the command python catnip_uploader.py releases
This command shows the avilable releases pulled from the CatSniffer-Firmware repository.
To load firmware to our board we can use the load command. For more information about the command we can run python catnip_uploader.py load --help
.
We can see that the command requiers two arguments, the firmware that we want to load and the COM port of our board. In previous version we needed an integer index value of the firmware that we could check using the releases command. In the latest version we can just use a word contained in the firmware name. For example for sniffer_fw_cc1252p_7
we can just use sniffer
. If we use a word that is shared by more than one firmware the tool will take the first option from the releases list. For example with airtag
the tool has to decide between airtag_scanner_cc1352p_7
and airtag_spoofer_cc1352p_7
. We can get around this by specifying more like airtag_spoofer
or just use another word like scanner
.
The load command has two options available: --validate: On the latest version of the tool, before loading any firware the tool will ask you if you sure you want to uplaod the firmware.
If you want to avoid this you can add the option --validate to the skip the check.
--help: You can use this option to get more information about how to use the load command.
To use the tool we just need to send the load command with the desired firmware and the correct COM port for our board.
One thing to keep in mind is that we need to restart the board between uploads or we could encounter an error.
After finished you can use the CatSniffer with the selected firmware.
This was the procedure to flash the CatSniffer. Try all our custom firmware!
Using the Python tool is the easiest and most recommended way to flash firmware to the CC1352, since it works on any operating system. But before we start there are some preparations we need to do in order to use the python tool.
-
Download the python tool from our repository or clone the whole repository (recommended) to your computer.
-
Upload the SerialPassThroughWithBoot firmware to your board's main chip.
-
Download Python using the following link. Look for the Operating System of your preference, in this case we use Windows.
- After the download is complete, install the software.
- We recommend that you select the ‘Add to PATH’ option when installing it so you do not have to do it manually later.
- Some python plugins are required, we can install them using the command line.
- On the search bar, type CMD, and run it as administrator.
-
Execute the following commands to install the plugins.
-
pip install pyserial
-
pip install intelhex
-
pip install python-magic
-
-
When the installation is finished, open a new cmd window or clean the console with the cls command. Then go to the path where you saved the python tool (cc2538-bsl.py) found on our repository using the cd command:
cd <directory_route>
-
Open the folder where you saved the python tool and copy the desired firmware (the one you are going to load to the board) onto the same folder where you have the python tool.
-
Now run the command:
python cc2538-bsl.py -h
-
The following menu will come up
- To continue with the process you need to know which COM port number has been assigned to your CatSniffer. Go to Device Manager and look for your CatSniffer device. For this example COM90 is what we are looking for.
- Return to the cmd console and run the comman
d python cc2538-bsl.py -p COMXX
. The argument -p is used to open the port, if the port is opened, then the connection was successful.
- Put your CatSniffer in bootloader mode and then write in console
python cc2538-bsl.py -e -w -v -p COM39 sniffer_fw_CC1352R.hex.
The argument -e erase the memory, the -w write on the chip and -v verify the image, the last parameter is the name of the file with extension. The .hex file must be on the folder cc2538-bsl.
- LED 4 will start blinking once the procedure finishes, indicating that CatSniffer has been successfully flashed.
Check out this video about Getting Started with the Catsniffer. For common issues with this method, please check our FAQ section.
If you have encountered an issue with your board that is not letting you load any firmware to the cc1352 in your board, please check out the section on how to recover your board.
-
-
- What is the CatSniffer?
- How can I use CatSniffer?
- What are the features of the CatSniffer?
- What can I do with the CatSniffer?
- What IoT protocols are supported by CatSniffer?
- How can I restore the CC1352 firmware on CatSniffer?
- How can I restore CC1352 firmware with RP2040 for CatSniffer V3?
- ERROR: Timeout waiting for ACK/NACK after Synch (0x55 0x55)
- What if SmartRF Packet Sniffer 2 doesn't detect my board?
- Why I got the error: unistd.h no such file or directory?
- Why CatSniffer can not connect with Zigbee2MQTT?
- What does this button do?