Coder Social home page Coder Social logo

sik's Introduction

SiK

Firmware for SiLabs Si1000 - Si102x/3x/6x ISM radios

Gitter

SiK is a collection of firmware and tools for radios based on the cheap, versatile SiLabs Si1000 and Si1060 SoC.

Branch Build Status

Build Status

Documentation

For user documentation please see ardupilot docs

Currently, it supports the following boards:

  • HopeRF HM-TRP
  • HopeRF RF50-DEMO
  • RFD900
  • RFD900u
  • RFD900p
  • MLAB ISM01A

Adding support for additional boards should not be difficult.

Currently the firmware components include:

  • A bootloader with support for firmware upgrades over the serial interface.
  • Radio firmware with support for parsing AT commands, storing parameters and FHSS/TDM functionality

AT commands

Command Variants Function
+++ Entering bootloader mode. Could be tested by sending AT, reply should be OK
RT remote AT command - send it to the tdm, system to send to the remote radio
AT&F Restore default parameters
AT&W Write parameters to the flash memory
AT&U Erase Flash signature forcing it into reprogram mode next reset
AT&P TDM change phase
AT&T AT&T
AT&T=RSSI
AT&T=TDM
disable all test modes
display RSSI stats
display TDM debug )
AT&E AT&E?
AT&E=
Print_encryption_key
Set encryption key
AT+ AT+P=
AT+Cx=y
AT+Fx?
AT+L
AT+A
set power level pwm to x immediately
write calibration value
get calibration value
lock bootloader area if all calibrations written
RFD900 antenna diversity
ATI0 banner_string
ATI1 version_string
ATI2 BOARD_ID
ATI3 Board design frequency
ATI4 Board boot loader version
ATI5 Parameters
ATI6 TDM timing
ATI7 Show RSSI
ATP ATPx=O
ATPx=I
ATPx=R
ATPx=Cx
Set pin to output, turn mirroring off pulling pin to ground
ATO
ATS ATS?
ATS=

Set a parameter
ATZ Generate a software reset

Up to date AT command processig is located in at.c source code.

What You Will Need

  • A Mac OS X or Linux system for building. Mac users will need the Developer Tools (Xcode) installed.
  • At least two Si1000 - Si102x/3x - based radio devices (just one radio by itself is not very useful).
  • A SiLabs USB debug adapter.
  • SDCC, version 3.1.0 or later.
  • EC2Tools
  • Mono to build and run the GUI firmware updater.
  • Python to run the command-line firmware updater.

Note that at this time, building on Windows systems is not supported. If someone wants to contribute and maintain the necessary pieces that would be wonderful.

Building Things

Type make install in the Firmware directory. If all is well, this will produce a folder called dst containing bootloader and firmware images.

If you want to fine-tune the build process, make help will give you more details.

Building the SiK firmware generates bootloaders and firmware for each of the supported boards. Many boards are available tuned to specific frequencies, but have no way for software on the Si1000 to detect which frequency the board is configured for. In this case, the build will produce different versions of the bootloader for each board. It's important to select the correct bootloader version for your board if this is the case.

Flashing and Uploading

The SiLabs debug adapter can be used to flash both the bootloader and the firmware. Alternatively, once the bootloader has been flashed the updater application can be used to update the firmware (it's faster than flashing, too).

The Firmware/tools/ec2upload script can be used to flash either a bootloader or firmware to an attached board with the SiLabs USB debug adapter. Further details on the connections required to flash a specific board should be found in the Firmware/include/board_*.h header for the board in question.

To use the updater application, open the SiKUploader/SikUploader.sln Mono solution file, build and run the application. Select the serial port connected to your radio and the appropriate firmware .hex file for the firmware you wish to uploader. You will need to get the board into the bootloader; how you do this varies from board to board, but it will normally involve either holding down a button or pulling a pin high or low when the board is reset or powered on.

For the supported boards:

  • HM-TRP: hold the CONFIG pin low when applying power to the board.
  • RF50-DEMO: hold the ENTER button down and press RST.
  • RFD900x: hold the BOOT/CTS pin low when applying power to the board.

The uploader application contains a bidirectional serial console that can be used for interacting with the radio firmware.

As an alternative to the Mono uploader, there is a Python-based command-line upload tool in Firmware/tools/uploader.py.

Supporting New Boards

Take a look at Firmware/include/board_*.h for the details of what board support entails. It will help to have a schematic for your board, and in the worst case, you may need to experiment a little to determine a suitable value for EZRADIOPRO_OSC_CAP_VALUE. To set the frequency codes for your board, edit the corresponding Firmware/include/rules_*.mk file.

Resources

SiLabs have an extensive collection of documentation, application notes and sample code available online.

Start at the Si1000 product page or Si102x/3x product page

Reporting Problems

Please use the GitHub issues link at the top of the project page to report any problems with, or to make suggestions about SiK. I encourage you to fork the project and make whatever use you may of it.

What does SiK mean?

It should really be Sik, since 'K' is the SI abbreviation for Kelvin, and what I meant was 'k', i.e. 1000. Someday I might change it.

sik's People

Contributors

andke avatar geeksville avatar gmorph avatar gumerrgz avatar joeman155 avatar jschall avatar kaklik avatar lhovo avatar lorenzmeier avatar neggles avatar patrickelectric avatar pelrun avatar povik avatar ritkit avatar saario avatar tridge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sik's Issues

Regarding the modification of the code in SiKradio

In SiKradio zip folder, When I made some modifications in required files in SiKradio firmware and "make" it and .ihx file is generated and When i uploaded this .ihx file into the module using Mission Planner, changes are not reflecting. For this , I need the Zip file of the latest version of SiKradio. I am getting error like below and how to resolve it.

Screenshot from 2024-04-30 17-47-51

Hacktoberfest: Python 3 compatibility issues

flake8 testing of https://github.com/ArduPilot/SiK on Python 3.7.1

$ flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics

./Firmware/tools/check_code.py:17:13: E999 SyntaxError: invalid syntax
    print sys.argv
            ^
./Firmware/tools/bank-alloc.py:143:31: E999 SyntaxError: invalid syntax
					print "Failed to allocate", module[0], "with size", module[1], \
                              ^
./Firmware/tools/update_mode.py:35:12: F821 undefined name 'pexpect'
    except pexpect.TIMEOUT:
           ^
./Firmware/tools/atcommander.py:269:81: E999 SyntaxError: invalid syntax
        print "Please specify a --list-* or --set-* operation (try -h if unsure)"
                                                                                ^
./Firmware/tools/rssi.py:51:31: E999 TabError: inconsistent use of tabs and spaces in indentation
            	sys.stdout.flush()
                              ^
./Firmware/tools/uploader.py:100:31: E999 TabError: inconsistent use of tabs and spaces in indentation
                if use_mavlink:
                              ^
5     E999 SyntaxError: invalid syntax
1     F821 undefined name 'pexpect'
6

E901,E999,F821,F822,F823 are the "showstopper" flake8 issues that can halt the runtime with a SyntaxError, NameError, etc. These 5 are different from most other flake8 issues which are merely "style violations" -- useful for readability but they do not effect runtime safety.

  • F821: undefined name name
  • F822: undefined name name in __all__
  • F823: local variable name referenced before assignment
  • E901: SyntaxError or IndentationError
  • E999: SyntaxError -- failed to compile a file into an Abstract Syntax Tree

The SiK Firmware documentation should be centralized

Crosstalk between different netids

Using the current master, I noticed that I get some of the (mavlink) packets sent from a device with different netid.

Having 3 radios A (netid = 25, plugged to pixhawk), B (netid = 25) and C (netid = 15) (see complete config below), communication between A and B seems to work fine. Plugging radio C, I receive quiet a few of the mavlink packets sent by A.

Using the old release-1-9, I didn't notice such a behavior.

Radio A

ATI
RFD SiK 2.0 on HM-TRP
ATI5
S0:FORMAT=26
S1:SERIAL_SPEED=57
S2:AIR_SPEED=64
S3:NETID=25
S4:TXPOWER=20
S5:ECC=1
S6:MAVLINK=1
S7:OPPRESEND=0
S8:MIN_FREQ=433050
S9:MAX_FREQ=434790
S10:NUM_CHANNELS=10
S11:DUTY_CYCLE=100
S12:LBT_RSSI=0
S13:MANCHESTER=0
S14:RTSCTS=0
S15:MAX_WINDOW=131

Radio B

ATI
RFD SiK 2.0 on HM-TRP
ATI5
S0:FORMAT=26
S1:SERIAL_SPEED=57
S2:AIR_SPEED=64
S3:NETID=25
S4:TXPOWER=20
S5:ECC=1
S6:MAVLINK=1
S7:OPPRESEND=1
S8:MIN_FREQ=433050
S9:MAX_FREQ=434790
S10:NUM_CHANNELS=10
S11:DUTY_CYCLE=100
S12:LBT_RSSI=0
S13:MANCHESTER=0
S14:RTSCTS=0
S15:MAX_WINDOW=131

Radio C

ATI
RFD SiK 2.0 on HM-TRP
ATI5
S0:FORMAT=26
S1:SERIAL_SPEED=57
S2:AIR_SPEED=64
S3:NETID=15
S4:TXPOWER=20
S5:ECC=1
S6:MAVLINK=1
S7:OPPRESEND=0
S8:MIN_FREQ=433050
S9:MAX_FREQ=434790
S10:NUM_CHANNELS=10
S11:DUTY_CYCLE=100
S12:LBT_RSSI=0
S13:MANCHESTER=0
S14:RTSCTS=0
S15:MAX_WINDOW=131

Missing tag/hash for release

Hi,
looking at the Release page or the git tag, only version 1.9 is tagged and also the realease beta is older than that release.
On the other hand the ReleaseNotes has reference to version 1.11, but no reference to hash of the commit or any other reference, not even a date.
Is looking at the commit on ReleaseNote the way to find out the hash of the release?

Could you please clarify the situation?

is current master supposed to work with Mavlink 1.0 ?

What am I missing ?
Compiled and flashed two radios, (format changed, so all settings are default) radios connect to each other and appear to work fine (solid green LED, I see terminal traffic pass)
Once one is connected to a pixhawk (that emits MavLink 1), it starts blinking red , and both radio's green LEDs start flashing (connection lost)

Custom SERIAL_SPEED

Hello,

I am trying to use SiK on a HM-TRP in order to transmit a 76800 bps UART over the air.

76800 bps is not in the known SERIAL_SPEED, so I modified serial.c to add it's support :

static const __code struct {
	uint8_t rate;
	uint8_t th1;
	uint8_t ckcon;
} serial_rates[] = {
	{1,   0x2C, 0x02}, // 1200
	{2,   0x96, 0x02}, // 2400
	{4,   0x2C, 0x00}, // 4800
	{9,   0x96, 0x00}, // 9600
	{19,  0x60, 0x01}, // 19200
	{38,  0xb0, 0x01}, // 38400
	{57,  0x2b, 0x08}, // 57600 - default
	{115, 0x96, 0x08}, // 115200
	{76,  0x61, 0x08}, // 76800 - replace the 203400
};

After compiling and firmware upload, I can select this new speed with AT commands. But after save eeprom and reboot, i am not able anymore to access AT mode by sending '+++' at 76800 bps...

Did I do something wrong ?

As long as the Si1000 UART baud rate is controled by the Timer1 Overflow, setting the TH1 register to 0x61 should do the job. Si1000 datasheet give the formula UartBaudRate = T1CLK / (2 * (256 - TH1)) so with a T1CLK of 24.5 MHz, this should give a good 77044 bps so only -0.32% error...

Note : I have Mavlink framing disabled.

Maybe should I stay on 1.9 stable release ?

Anyone tryed these intermediate but still standard baud rates ?

I know how to force bootloader mode at startup in order to upload again FW, but what baud rate should I use now ?

Thanks,

Georges

Stable Release 1.9 compilation error

Hi,
the "Stable release" 1.9 has a compilation error in Firmware/radio/Radio.c as the line

 static void    set_frequency_registers(uint32_t frequency);
 static uint32_t scale_uint32(uint32_t value, uint32_t scale);

are missing the __pdata

Support for RFD 868

I acceidently flashed a RFD868x with RFDSiK 3.01.
How can the it be restored?
When will it support the RFD868 also?

modifying radio.c does not take effect ?!

Hi, so i wanted to make some small modifications on the radio.c file but after i do when I build / make project it does not take effect. In fact I put some bad syntax errors in that file and the compiler doesn't even see it or complain. How can I make these changes take effect when building the firmware ?!

conflict with previous declaration of 'putchar'

Unable to build with sdcc 3.9.0:

CC radio/golay.c
CC radio/serial.c
radio/serial.c:541: error 98: conflict with previous declaration of 'putchar' for attribute 'type' at /usr/bin/../share/sdcc/include/stdio.h:86
from type 'int function ( int fixed) fixed'
  to type 'void function ( unsigned-char fixed) __reentrant fixed'
make[1]: *** [include/rules.mk:135: obj/rfd900a/radio~rfd900a/serial.rel] Error 1
make[1]: Leaving directory '/home/paulk/botlink/SiK/Firmware'
make: *** [Makefile:95: install~radio~rfd900a] Error 2

I changed the signature in serial.c to

int                                                                                                 
putchar(int c) __reentrant

and it's working fine for me. But I suspect there's a more correct fix.

I found what looks like the same issue on the sdcc mailing list from 2007, but the PUTCHAR definition doesn't exist, so the reply there was unhelpful.

Changing rfd868 min frequency to 865

Hi,
I am using rfd868+ with ardupilot and pixhawk.
As in India 865-867mhz is unlicensed, I was wondering if it is possible to reduce minimum frequency of rdd868 to 865mhz without having any side effects.

comparison is always true due to limited range of data type

In SiK/Firmware/Radio/parameter.c ,

// Place the start away from the other params to allow for expantion 2<<7 +128 = 384
#ifdef INCLUDE_AES
// Holds the encrpytion string
__xdata uint8_t encryption_key[32];

#define PARAM_E_FLASH_START   (2<<7) + 128
#define PARAM_E_FLASH_END     (PARAM_E_FLASH_START + sizeof(encryption_key) + 3)

// Check to make sure the End of the pins and the beginning of encryption dont overlap
typedef char p2eCheck[(PIN_FLASH_END < PARAM_E_FLASH_START) ? 0 : -1]; 

In the check comparison is always True due to limited range of data type is coming. I have tried to fix it but unable because of compiler. Anybody that successfully compiled this please let me know the compiler version and any other fix for this issue.

Idea: configure over mavlink

Would it make sense to add a mavlink message for configuring the transmit power? Then add TXPOWER and remote TXPOWER fields to RADIO_STATUS.

Broken Links on the README.markdown page

While looking for documentation on how to control these via a Raspberry Pi (on the vehicle side) I found that the links under the "Resources" section of the README.markdown page are broken. Is there any reference material on how this may be done?

Resources
SiLabs have an extensive collection of documentation, application notes and sample code available online.

Start at the Si1000 product page or Si102x/3x product page

I am attempting this with this set https://store.mrobotics.io/ProductDetails.asp?ProductCode=MRO-SIKV2AIRGND-MR

Forward/Exchange RTS&CTS pin status

What would be the easiest way to forward/exchange the RTS&CTS pin status between two radio boards?
RTS1 should set CTS2 and RTS2 should set CTS1.
Any pointer where to look in code are appreciated.

RFD900x Async V2.43

Using the RFD900x-AsyncRelease_V2.43.bin, it does not have SYNCANY, NODECOUNT, or NodeID can't be set to 0, parameters.

Multipoint release anytime soon?

The radio cannot enter AT after modifying parameters

The main control chip uses c8051f931. After flashing the firmware, use + + + to enter the at configuration command line. After saving the parameters with AT&W and restarting, try to enter at with + + + again, and the radio doesn't respond

stuck in bootloader with multiple SiK radios

hi, im able to load settings and use the current old firmware i had on my radios - (RFD900A V1.2, Holybro etc)
but when attempting to upload new firmware they get stuck in bootloader mode.
i cannot get the unstuck using all methods mentioned in RFD manual.
running Missionplanner 1.3.80

Firmware Installation Error.

On running a make install in the Firmware folder on an OSX, I get:

% build bootloader for hm_trp
obj/hm_trp/bootloader~hm_trp/bootloader.dep:1: *** missing separator.  Stop.
make: *** [build~bootloader~hm_trp] Error 2

Looks like it is some Makefile formatting issue but I could not lay may hands on it.

Command mode failure after AT&W - resulting in inability to flash unless forced into bootloader.

@tridge - please verify yourself - this is how it looks on my end:

I compile the current master and upload with --resetparams
All good, the hm_trp works just fine.
..and the command mode will fail permanently after AT&W (storing parameters to EEPROM)

To reproduce:
Flash current master to HM-TRP (probably others will have this issue too)
enter command mode in terminal, issue AT&W , ATZ (no need to actually change any setting)

Observe that you get echo after "+++" - but never an "OK" , in fact, no command return any output.
There is no way to change anything in command mode.

The only way to recover is to pull CTS down when booting, to force bootload mode.
The latest build of 2.0 does not have this issue.

Is there a transmitter diagnosis mode?

Is there a configuration that can produce a continuous transmission?
at 100% duty cycle, feeding as fast I can at 57600, it seems it is still sending far from continuously.
Even with only 1 frequency.
Can SiK be somehow tested to transmit continuously on a single frequency? (in order to test actual output using a RF power meter?)

How doe SIK determine if a link is being maintained

I am trying to understand better how the SIK radio determines whether there is a valid link or not. Are there messages that the radios send periodically to one another? If this is the case, where in the code could I find the details of these codes (i.e., what is transmitted, and how frequently?)

my RFD900 can't work stably

I am using RFD900v2 to link my drone. It just can't work stably. It just connects/ disconnects over and over again when it works. Why? This is my setting for it:

Uploading IMG_1814-1.mov…

setting

README.md

The second link in "documentetion-section" is dead.

Hope RF HM TRLR 868 Mhz

Hi

I am trying to use this module for telemetry between my GCS ( Mission Planner ) and a pixhawk 2.1 what should i do in order to flash the bootloader as there is only for HM TRP module thanks a lot in advance

best regards

LBT fix is not released so cannot conform to new EU regulations

SiK already supports LBT I see and an issue failing to save the setting appears to be fixed in one of the last commits c264c67 on October 17th 2015. But the beta and stable firmware released at http://firmware.diydrones.com/SiK are still from 2014.

Can somebody who already compiled this firmware please copy the binaries up to the DIY drones site, and if tested successfully consider making it "stable" so we are not breaking any new regulations (note even the FrSky firmware has been completely updated with new warnings on old models to update to LBT capable firmware, so this appears to be a serious regulation).

How to change default parameters

Hello,

I would like to change the factory default parameters. Are these the default parameters in the "parameters.c" file ?

__code const struct parameter_info {
const char *name;
param_t default_value;
} parameter_info[PARAM_MAX] = {
{"FORMAT", PARAM_FORMAT_CURRENT},
{"SERIAL_SPEED", 57}, // match APM default of 57600
{"AIR_SPEED", 64}, // relies on MAVLink flow control
{"NETID", 25},
{"TXPOWER", 20},
{"ECC", 0},
{"MAVLINK", 1},
{"OPPRESEND", 0},
{"MIN_FREQ", 0},
{"MAX_FREQ", 0},
{"NUM_CHANNELS", 0},
{"DUTY_CYCLE", 100},
{"LBT_RSSI", 0},
{"MANCHESTER", 0},
{"RTSCTS", 0},
{"MAX_WINDOW", 131},
#ifdef INCLUDE_AES
{"ENCRYPTION_LEVEL", 0}, // no Enycryption (0), 128 or 256 bit key
#endif
};

Unable to upload multipoint sik radio firmware

Radio used: 3DR Radio Telemetry 433MHz 500mW(X6)
I am trying to develop a multipoint drone swarm.for that purpose, I'm using the radio mentioned. Tried all the softwares to upload multipoint sik firmware no use.
Can somebody tell me what can go wrong while firmware update that if fails?
It's showing device name HM-TRP
XRock 4.0 version.
Is it atleast possible to upload sik firmware?

Using two pairs of Sik devices in the same area

Hi, would appreciate to get your opinion on the best way to configure the Siks in the presence of other pairs in the immediate area.

Approach 1:
Divide the frequency range into several distinct (and smaller) bands and allocate each pair with a unique range. Naturally also give unique net ids to each pair.

Approach 2:
Use the same range for all pairs, possibly with more channels, and rely on net id for conflict resolution.

btw, what would be the smallest channel width allowed?

Thanks.

RFD900+ Forbidden Frequencies

Our tests showed evidences that, even though we selected the desire range, max and minimum (915<->928Mhz) in the configuration software, RFD900+ is still emitting in other frequencies. We need to certificate that RFD900+ transmits just between 915<->928Mhz.
unnamed

Replies to heartbeat messages get mixed up with received mavlink messages

Using the latest firmware with RFD 868+ model from RF design we see the following behaviour:
We send heartbeat message from the serial connected computer in the air. At the same time, we send normal messages via USB from the ground computer.
The reply to the heartbeat message that is received in the air is getting mixed up with the normal messages from the ground (interleaved).

Is this a known bug?

Mavlink messages should never be split when the mavlink flag is enabled.

AES encryption

As the documentation states currently following boards are supported by the SiK radio firmware:

  • HopeRF HM-TRP
  • HopeRF RF50-DEMO
  • RFD900
  • RFD900u
  • RFD900p

Can anyone please give feetback which of these boards support AES encryption? Is it correct that only SiLabs Si102x/3x are supported for encryption by the firmware, since these have hardware acceleration for aes-128 and aes-256 encryption?

Low latency

Is there any plan to reimplement the low latency mode? Why was it removed in the first place? It'd be great to have this working with MANUAL_CONTROL packets for px4.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.