├── LICENSE ├── README.md ├── fw ├── COMPILE.md ├── FLASHING.md ├── OPERATION_MANUAL.md ├── arduino-ide_variant-files │ ├── boards.txt │ └── variants │ │ └── STM32L4xx │ │ └── L412RB(I-T)xP │ │ ├── CMakeLists.txt │ │ ├── PeripheralPins.c │ │ ├── PinNamesVar.h │ │ ├── boards_entry.txt │ │ ├── generic_clock.c │ │ ├── ldscript.ld │ │ ├── variant_generic.cpp │ │ └── variant_generic.h ├── fw-files │ ├── old-structure │ │ ├── rs41-nfw_v20 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ ├── rs41-nfw_v20.ino │ │ │ └── v20-default.bin │ │ ├── rs41-nfw_v21 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ ├── rs41-nfw_v21.ino │ │ │ ├── v21-default-rsm4x2.bin │ │ │ └── v21-default-rsm4x4.bin │ │ ├── rs41-nfw_v22 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ ├── rs41-nfw_v22.ino │ │ │ └── v22-default-rsm4x4.bin │ │ ├── rs41-nfw_v23 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ ├── rs41-nfw_v23.ino │ │ │ ├── v23-default-rsm4x2.bin │ │ │ └── v23-default-rsm4x4.bin │ │ ├── rs41-nfw_v231 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ ├── rs41-nfw_v231.ino │ │ │ └── v231-default-rsm4x4.bin │ │ ├── rs41-nfw_v24 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ ├── rs41-nfw_v24.ino │ │ │ └── v24-default-rsm4x4.bin │ │ ├── rs41-nfw_v25 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ ├── rs41-nfw_v25.ino │ │ │ └── v25-default-rsm4x4.bin │ │ ├── rs41-nfw_v26 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ ├── rs41-nfw_v26.ino │ │ │ ├── v26-default-rsm4x2.bin │ │ │ └── v26-default-rsm4x4.bin │ │ ├── rs41-nfw_v27 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ ├── rs41-nfw_v27.ino │ │ │ ├── v27-default-rsm4x2.bin │ │ │ └── v27-default-rsm4x4.bin │ │ ├── rs41-nfw_v28 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ ├── rs41-nfw_v28.ino │ │ │ ├── v28-default-rsm4x2.bin │ │ │ └── v28-default-rsm4x4.bin │ │ ├── rs41-nfw_v29 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ ├── rs41-nfw_v29.ino │ │ │ ├── v29-default-rsm4x2.bin │ │ │ └── v29-default-rsm4x4.bin │ │ ├── rs41-nfw_v30 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ ├── rs41-nfw_v30.ino │ │ │ ├── v30-default-rsm4x2.bin │ │ │ └── v30-default-rsm4x4.bin │ │ ├── rs41-nfw_v31 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ ├── rs41-nfw_v31.ino │ │ │ ├── v31-default-rsm4x2.bin │ │ │ └── v31-default-rsm4x4.bin │ │ ├── rs41-nfw_v32 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ ├── rs41-nfw_v32.ino │ │ │ ├── v32-default-rsm4x2.bin │ │ │ └── v32-default-rsm4x4.bin │ │ ├── rs41-nfw_v33 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v33.ino │ │ ├── rs41-nfw_v34 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v34.ino │ │ ├── rs41-nfw_v35 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v35.ino │ │ ├── rs41-nfw_v36 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v36.ino │ │ ├── rs41-nfw_v37 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v37.ino │ │ ├── rs41-nfw_v38 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v38.ino │ │ ├── rs41-nfw_v39 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v39.ino │ │ ├── rs41-nfw_v40 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v40.ino │ │ ├── rs41-nfw_v41 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v41.ino │ │ ├── rs41-nfw_v42 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v42.ino │ │ ├── rs41-nfw_v43 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v43.ino │ │ ├── rs41-nfw_v44 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v44.ino │ │ ├── rs41-nfw_v45 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v45.ino │ │ ├── rs41-nfw_v46 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v46.ino │ │ ├── rs41-nfw_v47 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v47.ino │ │ ├── rs41-nfw_v48 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v48.ino │ │ ├── rs41-nfw_v49 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v49.ino │ │ ├── rs41-nfw_v50 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v50.ino │ │ ├── rs41-nfw_v51 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v51.ino │ │ ├── rs41-nfw_v52 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v52.ino │ │ ├── rs41-nfw_v53 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v53.ino │ │ └── rs41-nfw_v54 │ │ │ ├── horus_l2.cpp │ │ │ ├── horus_l2.h │ │ │ └── rs41-nfw_v54.ino │ └── rs41-nfw │ │ ├── horus_l2.cpp │ │ ├── horus_l2.h │ │ └── rs41-nfw.ino ├── nfw-dataRecorder-decoder │ └── decoder.py └── photos │ ├── aprs-waterfall.png │ ├── erase_and_upload.png │ ├── horus-waterfall.png │ ├── main_window.png │ ├── mcu-unlock-rsm412.png │ ├── mcu-unlock-rsm414.png │ ├── morse-waterfall.png │ ├── pip-waterfall.png │ ├── rtty-waterfall.png │ └── stlink-connection.png └── hw ├── README.md └── photos ├── front.JPG ├── rear.JPG └── rs41-rsm414_uC.png /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # RS41-NFW - Versatile, custom firmware for ALL revisions of Vaisala RS41 radiosondes 2 | ## **Vaisala RS41 New Firmware** (*RS41 Nevvman's Firmware*)
3 | **NOTE:** This firmware works with the ALL variants of RS41 radiosondes, with the new ones too, bringing full hardware and software support with lots of features for everyone. More below.

4 | Vaisala some time ago began launching new RS41 sondes, with new internal design. They can be recognized by a last digit of 4 of the PCB model (eg. `RSM414`, `RSM424`). This firmware is an approach for reusing them as amateur devices for many different purposes. It also brings full support for older models.
5 | 6 | * [RS41-NFW Firmware features](#rs41-nfw-firmware-features) 7 | * [Terms of Use](#terms-of-use) 8 | * [Radiosondes?](#radiosondes) 9 | * [Installation guide](#installation-guide) 10 | * [Firmware flashing](#firmware-flashing) 11 | * [Firmware compilation](#firmware-compilation) 12 | * [Firmware and device operation](#firmware-and-device-operation) 13 | * [RSM414 hardware](#rsm414-hardware) 14 | * [Firmware changelog](#firmware-changelog) 15 | * [Authors and contributors to this branch](#authors-and-contributors-to-this-branch) 16 | * [References](#references) 17 | * [Final notes](#final-notes) 18 | 19 | ## RS41-NFW Firmware features 20 | * **Full support for ALL** RS41 versions (eg. `RSM421`, `RSM412`, `RSM414`, `RSM424`), including the old and new ones with the '4' at the end of the PCB model 21 | * Multiple, customizable transmission modes 22 | * [**Horus Binary 4FSK v2**](https://github.com/projecthorus/horusdemodlib/wiki) 23 | * One of the most efficient radio modes for HAB and other simple telemetry designs, allows for decoding of very weak signals 24 | * Multi-QRG operation (ability to specify second Horus one, user can modify the code easily to get as much QRGs as wanted on every mode) 25 | * APRS 26 | * 1200 baud, with 1200Hz and 2200Hz tones, achieved by FSK switching in a precisely tuned loop (very good performance) 27 | * Many config options, including HAB (PSTVC structure compliant with RS41ng) and WX station reporting formats, overlay symbol modifier, SSID, destination (`APZNFW` supported and decoded by SondeHub), digi, etc. 28 | * RTTY 29 | * Customizable 45, 75 and 100 baud rates, also other available 30 | * Customizable tone spacing as a multiplication of 270Hz, default 570Hz 31 | * Data bits and stop bits customizable (default 7N2) 32 | * Compliant with UKHAS format. Provided by OM3BC 33 | * Morse code (CW) 34 | * Customizable wpm speed and dot length 35 | * Compliant with UKHAS format 36 | * PIP 37 | * Beacon operation, transmitting short beep with a specified interval, which could be used as a foxhunting TX device 38 | * Thorough support of RS41 hardware, including GPS, radio, power circuitry, reference heating etc. ...and: 39 | * Support for **onboard boom sensors**, including **temperature and humidity** sensors. Pressure *estimation* (like SG models) 40 | * Detailed in-built **debugging** features via LED status and serial messages 41 | * Onboard **button** allowing user to change different operation modes and parameters 'in-flight' 42 | * **Safety features**, including GPS watchdog and position improvement (these two improve flights in environments with interference/noise), battery voltage protection, sensors defrosting and condensation prevention, system reset watchdog 43 | * Support for extending hardware capabilities, including **OIF411** 44 | * **Power saving** features, including GPS power management (together with powersaving modes and OFF mode for stationary use cases) and automatic radio adjusting 45 | * **User-friendly** firmware and IDE allows users to easily customimze the device operation 46 | * Weather station mode, supporting APRS WX report, constant coordinates 47 | * Fox hunting mode, with CW and FM audio beacons 48 | * Flight controling algorithms. Ability to rapidly send packets when below set altitude. Data analysis and debug sent via APRS extended packets every set interval 49 | * Automatic calibration modes for temperature and humidity sensors on the silver boom, ground-check procedures, humidity module reconditioning. Ability to further improve accuracy by manually calibrating the readings 50 | * And many more - mentioned in [changelog](#firmware-changelog) and [manual](./fw/OPERATION_MANUAL.md) 51 | 52 | 53 | ## Terms of Use 54 | **RS41-NFW** project (author - Franek *nevvman SP5FRA*) is released under **GNU GPL-3.0 license**. This software is **open source** and **free to use for amateur projects**, **which cannot lead to profit** in any kind. This excludes usage of this firmware as a commercial product. **For commercial use, please contact me**. 55 | The creator of this project isn't at all responsible for any kind of harm made by devices operated with these instructions. Follow your local law about radio transmissions and ballon flights. Altough the firmware **tested successfully** on several dozen of flights, keep in mind that it is still a *hobbyst project*. 56 | 57 | 58 | ## Radiosondes? 59 | These small electronic devices are used by weather instututes to perform atmospheric sounding and high altitude measurements, up to the stratosphere (HAB - high altitude balooning). After the flight, usually they are *meaningless* for the launch company, so they can be collected by people (verify this according to the certain launch site). This acvitivty is called *radiosonde hunting*

60 | The most simple and costless way of collecting radiosondes is to track them on sites like [radiosondy.info](https://radiosondy.info/) or [SondeHub](https://sondehub.org/) (previously HabHub).
61 | Another, more advanced way is to hunt them with radio receivers. Most of them transmit on the EU 400-406 MHz radiosonde band, near an amateur 70cm band. You can do that by a simple direction finding with a directional (for example Yagi) antenna and a handheld receiver.

62 | But, currently the best way is to utilize a Software-Defined Radio (SDR, for example an RTL-SDR v3 / v4, Nooelec SDR, RSP1 or HackRF) together with a 70cm band antenna (dipole should work for sondes in air as far as 100km, the best is a high gain Yagi, with this setup you could easily hear a radiosonde hundreds kilometers away) and a specialized software for a computer, laptop or a Raspberry Pi. On the internet you will find lots of tutorials for receiver setup, tracking and hunting of them.

63 | **Kind note:** After each hunt, either successful or not, please change the radiosonde status on the previously mentioned trakcing sites. This will not only let many people save on fuel and patience, but also allow everyone to take a look on sounding statistics and other things. On the most simple site for tracking (SondeHub) you don't even need to create an account to change the sonde status, which only takes a minute.
64 | *It's an unpleasant feeling, when after driving dozens of kilometers in search for radiosonde you come across an empty field without any ballon traces.*

65 | For more details about HAB and sonde hunting, please look on google and social media, there is a ton of valuable content. 66 | 67 | ## Installation guide 68 | A thorough, detailed project guide is available at the links below.
69 | **If you want to fully utilize all capabilities of this firmware**, please, read the documentation in the following header order: 70 | 71 | 72 | ## Firmware flashing 73 | See: [fw/FLASHING.md](./fw/FLASHING.md) 74 | 75 | 76 | ## Firmware compilation 77 | See: [fw/COMPILE.md](./fw/COMPILE.md) 78 | 79 | 80 | ## Firmware and device operation 81 | See: [fw/OPERATION_MANUAL.md](./fw/OPERATION_MANUAL.md) 82 | The options in the firmware file should be self explanatory (alongside with the comments near them). This manual should be up-to-date, but there may be some issues with it (it's hard to manage that long markdown file, sorry :) ). If you have **any** problems, questions and suggestions, feel free to open issues here! 83 | 84 | 85 | ## RSM414 hardware 86 | See: [hw/README.md](./hw/README.md) 87 | 88 | 89 | ## Firmware changelog 90 | * `v55` - Si4032 radio now consumes 10-15mA less current than before, due to a misunderstanding of operation stages, allowing now to sleep properly between transmissions. Ability to specify TX power in each mode. Removed power save mode which changed interval and power below a certain altitude, which was a clone of a newer feature called `lowAltitudeFastTx`. Ability yo specify constant altitude when stationary use with no GPS. Others. 91 | * `v54` - power OFF routine modification, making the procedure status more clear. APRS temperature reporting length improvement. 92 | * `v53` - timing improvements down to milliseconds, with help of Bernd DL1XH. More talkative UART debug messages. 93 | * `v52` - heating bug with time management, APRS format improvement 94 | * `v51` - small corrections and improvements 95 | * `v50` - issue [20 fix](https://github.com/Nevvman18/rs41-nfw/issues/20) corrected description. Improved accuracy of both temperature and humidity reading based on empirical tests. Added optional reconditioning phase before zero-humidity check. Improved reference area heating and humidity sensor heating control algorithms, allowing to run more smoothly and precisely. More customization options. 96 | * `v49` - issue [18 fix](https://github.com/Nevvman18/rs41-nfw/issues/18). Si4032 temperature measurement change, to accurately measure negative temperatures. Option to calibrate temperature sensors using: manual offset setting, automatic calibration with entered air temperature and automatic calibration based on PCB temperature. Sensor boom diagnostics improvement. Vertical velocity calculation algorithm returns 0 if no fix. Default settings changed slightly. Stability and code structure improvements. Repo versioning fix. 97 | * `v48` - RTTY format, timing and customization bugfix and enhancements by OM3BC ([issue 15](https://github.com/Nevvman18/rs41-nfw/issues/15)), firmware crash fix ([issue 16](https://github.com/Nevvman18/rs41-nfw/issues/16)), APRS coordinate bugfix by KB8RCO ([issue 17](https://github.com/Nevvman18/rs41-nfw/issues/17)). Improvement in APRS timings. 98 | * `v47` - watchdog bugfix, which could to a sudden restart of GPS during flight (once every 30 minutes), due to a wrong condition check. Fixed and no problem. 99 | * `v46` - GPS bugfix, previous flights shouldn't have been affected 100 | * `v45` - pressure estimation can now be enabled/disabled. Also added what was forgotten - user input of sea level pressure. 101 | * `v44` - humidity readings accuracy improvement, temperature compensation improvement, GPS abnormalities detection with sending to ground in dataRecorder APRS extended packets, HDOP value in dataRecorder packets, other minor improvements 102 | * `v43` - minor improvements 103 | * `v42` - dataRecorder functionality improvement, which additionally sends power of all 3 heaters, temperatures of radio and references area and battery voltage in mV 104 | * `v41` - PWM humidity sensor heating, just like in the Vaisala firmware, which maintains the humidity module temperature ~5K above air temperature (by default). References heating improvement, which maintains the temperature more stabily and using 3 different power levels for power saving and efficiency. Improved calibration function based on variable heating power, speeding up the process. Pressure estimation (like in RS41-SG models?, here based on altitude, temperature and RH) sent via Horus and APRS WX packets. APRS coordinates conversion script adjustment based on RS41ng function. 105 | * `v40` - now the `referenceHeating` option works like in the Vaisala firmware, maintaing temperature around 18*C. 106 | * `v39` - performance improvements, minor changes 107 | * `v38` - bugfix for delay variable initialization, which could lead to overflow if set at 65 seconds or higher 108 | * `v37` - fox hunting mode, which can transmit a melody over NFM, CW pip, CW morse with additional message contents of location below voltage warning and battery voltage reporting, this mode operates in as low power consumption as possible (measurement circuits disabled, heaters disabled, GPS disabled, radio sleeping between transmissions). The gpsSpeed value in Horus v2 payload is now reported in km/h (instead of m/s as before). Small changes in startup and calibration procedure. 109 | * `v36` - changes in button operation algorithm - user can select between completely disabled button functions, sonde shutdown on button press or extended mode, which allows to change some parameters of the sonde. The button operation is available now throughout the whole operation of the sonde, in some limited areas (like calibrartion) the button can shutdown the sonde now. 110 | * `v35` - fixed boom calibration issue, which could lead to worse humidity compensation. Enhanced defrosting algorithm, that doesn't impact the readings. 111 | * `v34` - support for onboard humidity sensor reading (not the most accurate method, but gives reasonable readings with easy use). Humidity module calibration modes and auto-compensation (some parts of it known as zero-humidity check). Defrosting features. Reference resistors warming to maintain their temperature. Automatic temperature compensation for humidity module sensor readings. Depreciated oscillator heating capabilities - RTTY isn't widely used, especiallu at 75-baud and the option was very power hungry - now the resistors are used like from factory, to slightly warm up the reference resistors and capacitor. 112 | * `v33` - added option to disable the button operation. New dataRecorder feature, that saves most important statistics from flight and transmits them in APRS comments once for a specified time (by default every 10 minutes). Flight computing abilities, that measure flight parameters (min/max values; flight, burst and landing phase detection, etc.). New ultraPowerSaveAfterLanding feature, that lowers the power consumption as much as possible 30 minutes after landing (GPS is fully OFF, sensors and peripherals get disabled) and transmits the last coordinates every 10 minutes via Horus and APRS (+ dataRecorder statistics). Added a watchdog that resets the CPU after specified time (2 weeks by default) to protect from overflowing. 113 | * `v32` - added APRS 2 reporting modes - normal HAB tracking format and WX report format for weather station use. GPS operation modes - disabled, max performance, power saving; utilizing automatic powersaving switching to ensure best power consumption with reliable tracking. New feature, which transmits Horus packets as fast as possible (6s) at low altitudes (< 1km) for specified time when descending, to ensure that the lowest frame is captured. RTTY and Morse TX format now compliant with UKHAS formatting. 114 | * `v31` - added APRS support (not copied), GPS no-fix timeout watchdog (resets the chip if it can't get a fix for long enough), GPS performance improvement in position gathering, 2nd Horus TX frequency (with alternating mode and repeating packest), code clean-up, other small fixes and preparations for next releases 115 | * `v30` - added vertical velocity calculation and reporting via Horus v2. New and more accurate synchronization of delays between TX modes, fixnig issue were the delay was doubled in certain conditions. 116 | * `v29` - final fix for GPS dynamic model setting - both old and new boards tested (new tested in-flight, old checked through u-center and will be tested in-flight soon). GPS tracking should be now trustworthy (still no verification mechanism, but shouldn't be for now a big concern). 117 | * `v28` - full compatibility of default Horus v2 payload format with RS41ng default format. Detection of external power supply (for example via programmer) disabling button functionality to prevent unpredictable device operation. 118 | * `v27` - support for sensor boom - accurate readings of external temperature and humidity module temperature (humidity measurement not supported **yet**), Horus v2 format corrections (default payload uses the same format as RS41ng). 119 | * `v26` - added missing feature on older RS41 (`RSM4x1`, `RSM4x2`) sondes - reference heating, which is activated by Si4032 GPIO pin. 120 | * `v25` - powerSave mode, featuring automaticaly-adjustable TX power and transmission intervals, based on the altitude. Changed default values of the firmware. 121 | * `v24` - some improvements in the GPS Dynamic Model setting, support for both old and new sondes, simple VALSET & VALGET validation mechanism for the new sondes. The Airborne 1G mode is still experimental! 122 | * `v231` - fix issues of the previous *release v2.3*, thanks to [(still) this issue #3](https://github.com/Nevvman18/rs41-nfw/issues/3). Changed OIF411 data interpretation according to the operation manual (raw data division). 123 | * `v23` - added experimental uBlox GPS Airborne 1G Dynamic Model selection via UART of the module, thanks to [this issue #3](https://github.com/Nevvman18/rs41-nfw/issues/3) 124 | * `v22` - support for OIF411 ozone sounding system (including decoding the ozone info and transmision to ground), XDATA port mode selection (disabled, debug UART, XDATA UART), easy method of changing the payload-ID in Horus v2 mode, height activated oscillator heater 125 | * `v21` - added support for old RS41 models (`RSM412`) 126 | * `v20` - initial public release, releases before this were never published 127 | 128 |
129 | 130 | Incoming features: 131 | * Somehow get the RPM411 to work 132 | 133 | 134 | ## People responsible for this project 135 | * Authors 136 | * **Franek SP5FRA 'nevvman'** 137 | * Contributors - speical thanks to: 138 | * My dad, for his help in catching the radiosondes and suggestions 139 | * Erik PA0ESH - helped with lots of issues 140 | * Mark VK5QI - for help with GPS settings, Horus and sensors 141 | * zanco PE2BZ - for a test flight and other notes 142 | * Ludwik SP6MPL - for a few flights and big help in development 143 | * Mateusz SP3WRO - for test flights, kind words and help in development, and also his team 144 | * [radioszynka blog](https://radioszynka.pl/) team - for article about this project 145 | * Mark PC9DB - TX formats etc. 146 | * KB8RCO - big thread about APRS (also code to fix coordinate issue), WX use and others 147 | * whallman DF7PN - much help in discussions 148 | * Damian SQ2DEF and his team - SQ6KXY, Paweł, Lechu, McXander, wprzyb, Michał, Hubert... 149 | * obi7zik - thread about GPS power mode issue 150 | * OM3BC - big help in getting the RTTY to finally have a proper format and timings 151 | * People from *Radiosondy Polska* group - Jarosław, Wojtek... - kind words in a local group argument 152 | 153 | 154 | ## References 155 | * [*RS41ng* - inspiration for this project (NFW is not a fork of any kind (too much differing to be called so), just a few pieces of it's code structure is used here)](https://github.com/mikaelnousiainen/RS41ng)
156 | * [**RS41ng - issues discussion about new models and supporting them**](https://github.com/mikaelnousiainen/RS41ng/issues/92) 157 | * [*RS41HUP* - also inspiration](https://github.com/darksidelemm/RS41HUP)
158 | * [*radiosonde_hardware* - made reversing the new version easier](https://github.com/bazjo/radiosonde_hardware)
159 | * [*Horus Binary* - awesome HAB radio protocol](https://github.com/projecthorus/horusdemodlib)
160 | * [*Arduino APRS*](https://handiko.github.io/Arduino-APRS/) library, partially utilized here to create APRS messages 161 | -------------------------------------------------------------------------------- /fw/COMPILE.md: -------------------------------------------------------------------------------- 1 | # Firmware compile 2 | This firmware was written in the Arduino IDE. It is a beginner-friendly IDE with support of tons of different MCUs, made with one of the largest communities that work with embedded coding.
3 | 4 | **NOTE:** The [New sondes compiler configuration guide](#new-sondes-compiler-configuration-guide) setup has to be done **only** if you have newer version of sondes, eg. `RSM414`. The older versions have the compiler definitions set in the default core package. The sonde version can be determined [here](../hw/README.md#older-vs-newer---how-do-i-know-which-one-im-holding-now). 5 | 6 | All the steps shown here may look hard and confusing, but doing everything step-by-step should do everything for you. This thing will take 5 minutes.
7 | 8 | * [Adding an STM32 core](#adding-an-stm32-core-to-the-arduino-ide-board-manager) 9 | * [New sondes compiler configuration guide](#new-sondes-compiler-configuration-guide) 10 | * [Board selection](#board-selection) 11 | * [Additional libraries](#additional-libraries) 12 | 13 | ## Adding an STM32 core to the Arduino IDE board manager 14 | To make things work, the Arduino IDE has to use the STM32 core to provide functionalities for STM32 microcontrollers: 15 | * Download the new, 2.x version of the Arduino IDE and run it (Arduino IDE had made a big change in its IDE, that's why versions now start with 2.x) 16 | * Click on **(IDE) File -> Preferences** 17 | * In the **Additional Boards Manager URLs**, add the new line with this board manager URL: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json 18 | * Exit the Preferences window. Then open the **Boards Manager** using the toolbar on the right or by entering **(IDE) Tools -> Board -> Boards Manager...** 19 | * Search for the **STM32 MCU based boards** *by STMicroelectronics* (search in the top field for the *stm32* phrase), check that the newest stable version is selected (*3.2?* was tested for now, which is the newest by the day of writing this) and click **Install**. 20 | * The installation will take a while, especially on slower computers and network connections. The progress can be seen in the bottom debug window. 21 | * After the installation is completed, restart the Arduino IDE. Ideally, restart the computer. 22 | * After this is done, make sure that you have installed the **STM32CubeProgrammer**, because Arduino IDE may query it for uploading the binary to the MCU. 23 | 24 | 25 | ## New sondes compiler configuration guide 26 | If you have a **newer** sonde version, you have to follow this guide.
27 | 28 | To make sure that everything will work properly, the internal IDE configuration has to be changed.
29 | 30 | What we need to do is to add a **new board variant**. Arduino defines it as an *additional folder that is compiled together with the core and allows platform developers to easily add specific configurations.* 31 | 32 | After you correctly added the official STM32 core to Arduino IDE board manager, now you have to make a few changes. 33 | 34 | * Close the Arduino IDE. 35 | * Download and extract from this repo the folder under this location: `fw/arduino-ide_variant-files/`. It will be needed later. 36 | * For now, delete whole cached data folder named `arduino-ide` (one time work, there is an [issue](https://github.com/arduino/arduino-ide/issues/1030#issuecomment-1152005617) that the new variants don't show up without cache purge), located here (replace USERNAME with your OS username you work on): 37 | * `C:\Users\USERNAME\AppData\Roaming\arduino-ide\` on Windows 7 and later 38 | * `~/.config/arduino-ide/` on Linux GUI 39 | * `~/Library/Application Support/arduino-ide` on macOS 40 | * Locate the sources folder (replace USERNAME with your OS username you work on), this will be the place that you will work in now: 41 | * `C:\Users\USERNAME\AppData\Local\Arduino15\` on Windows 7 and later 42 | * `~/.arduino15/` on Linux GUI 43 | * `~/Library/Arduino15/` on macOS 44 | * Go to the `variants` folder of the STM32 core: 45 | * `[sources folder]./packages/STMicroelectronics/hardware/stm32/[your STM32 core version]/variants` - default variants folder location 46 | * `C:\Users\USERNAME\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.8.1\variants` - example for Windows based machine with the newest STM32 core version 47 | * Enter the family name folder, for our case it is a `./STM32L4xx` 48 | * Here, for our new sonde, you want to locate the `L412RB(I-T)xP` folder, delete it and replace it with [this](./arduino-ide_variant-files/variants/STM32L4xx/L412RB(I-T)xP/) folder, from this repo (`fw/arduino-ide_variant-files/variants/STM32L4xx/L412RB(I-T)xP/`). 49 | * If you swapped the new variant folder in place, make sure that it contains 8 files and that the folder swapped correctly, then go back to the version folder (`[sources folder]./packages/STMicroelectronics/hardware/stm32/[your STM32 core version]/`), from there open `boards.txt` file in a text editor, search for the `Generic L4` line, and in the alphabetical order (not a must, just looks nicer) add an entry from [`boards.txt` file from this repo](./arduino-ide_variant-files/boards.txt) between other variants. Save the file and close. 50 | * **Your IDE should now be good to go** 51 | 52 | ## Board selection 53 | This depends on the PCB version you have.
54 | 55 | * Open Arduino IDE 56 | * For older versions (eg. `RSM412`): 57 | * Select the **Generic STM32F1 series** under **(IDE) Tools**, then go to **(IDE) Tools -> Board part number:** and select **Generic F100C8Tx**. 58 | * For newer versions (eg. `RSM414`, `RSM424`): 59 | * Select the **Generic STM32L4 series** under **(IDE) Tools**, then go to **(IDE) Tools -> Board part number:** and select the newely installed **Generic L412RBTxP**. Don't see it? Make sure you followed the [above](#new-sondes-compiler-configuration-guide) guide. 60 | * Select the appropriate programmer - **(IDE) Tools -> Programmer: -> STMicroelectronics ST-LINK** 61 | * Select compiler optimization config as **Smallest (-Os default)**. 62 | 63 | 64 | ## Additional libraries 65 | 66 | Besides the compiler configuration, you also have to add necessary libraries to your environment.
67 | Currently needed libraries for this project: 68 | * TinyGPS++ 69 | * Visit https://github.com/mikalhart/TinyGPSPlus and **download** code as a .zip file (green code button). 70 | * In Arduino IDE, go to **(IDE) Sketch -> Include Library... -> Add .ZIP Library** and select the already downloaded .zip file. 71 | * After a while, it should be installed, the progress can be seen on the bottom of the IDE. 72 | * Adafruit_BME280 (only for future versions, not used currently) 73 | * Visit https://github.com/adafruit/Adafruit_BME280_Library and **download** code as a .zip file (green code button). 74 | * In Arduino IDE, go to **(IDE) Sketch -> Include Library... -> Add .ZIP Library** and select the already downloaded .zip file. 75 | * After a while, it should be installed, the progress can be seen on the bottom of the IDE. 76 | 77 |
78 | 79 | **Your compilation environment is now fully set-up!** -------------------------------------------------------------------------------- /fw/FLASHING.md: -------------------------------------------------------------------------------- 1 | # Firmware flashing 2 | To install the firmware on the RS41 radiosonde, you should follow these instructions. 3 | 4 | * [Requirements](#requirements) 5 | * [Connecting the programmer to the sonde](#connecting-the-programmer-to-the-sonde) 6 | * [Unlocking the factory MCU protection](#unlocking-the-factory-mcu-protection) 7 | * [*Uploading the pre-compiled binary*](#uploading-the-pre-compiled-binary) 8 | * [Uploading the Arduino Code](#uploading-the-arduino-code) 9 | 10 | ## Requirements 11 | * **Hardware-side**: 12 | * Vaisala RS41 sonde (firmware supports [all versions](../hw/README.md#older-vs-newer---how-do-i-know-which-one-im-holding-now)) 13 | * ST-Link compatible programmer - cheap v2 clone was confirmed working. Any expensive original programmer or most clones from china that look like [this](https://sklep.msalamon.pl/wp-content/uploads/2024/07/sklep_msalamon_STLINK_USB_RED.jpg) should work. Also, any other programmer that supports ST's SWD programming protocol and debuging should do the job. 14 | * Some jumper wires (often included with programmers). 15 | * Windows, Linux (and probably Mac) computer, software described below. 16 | 17 |
18 | 19 | **NOTE:** Pre-compiled binaries provide few customization options compared to compiling the firmware itself! The only recommended solution for HAB and other stuff is to compile the binary itself, it isn't hard with the guide.
20 | The pre-compiled binary should never be used, unless you can't compile the binary or you only want to test some part of the default firmware config. 21 | 22 | **Note:** If you can't find the binary for your platform (sometimes the binary for OLD revisions will be missing), this means that the firmware was *not tested* on the missing platform. HOWEVER, this does **not** mean that the missing platform won't work with the specified firmware. In 95% of the cases the missing platform will just need the compilation and will work just fine. Only concern would be some stabillity issues, which are the left 5% of the chance. Usually, the missing platform will be supplied with support in the next release. 23 | 24 | **Note:** Pre-compiled binaries use default settings and configurations, which are the same that the firmware source file is distributed with. 25 | 26 |
**Note:** Radiosondes that are factory new, with original firmware, need to be [unlocked](#unlocking-the-factory-mcu-protection). 27 | 28 | * **Software-side**: 29 | * For flasing a **pre-compiled binary**, you will need: 30 | * A pre-compiled binary (should be in the .bin format) - download a preferred version either from [there](./fw-files/) or from the releases page. 31 | * [STM32CubeProgrammer](https://www.st.com/en/development-tools/stm32cubeprog.html) or any debuger program (stm32flash on Linux for example) that can utilize the ST-Link to upload the binary to it. This tutorial will cover STM32CubeProgrammer running on Windows and in the future there will be a tutorial for stm32flash on Linux. 32 | * For **compiling** and flashing **your own code**, you will need: 33 | * [STM32CubeProgrammer](https://www.st.com/en/development-tools/stm32cubeprog.html) - used by Arduino IDE in the flashing process and to unlock the memory. 34 | * A properly configured Arduino IDE - more on that further in this text, with tutorial 35 | 36 | 37 | ## Connecting the programmer to the sonde 38 | After you met all needed requirements for your purposes, you have to connect the programmer to the Vaisala sonde.
39 | 40 | The connector has a pinout like this: 41 | ``` 42 | Pinout of XDATA connector Pinout of connected ribbon cable 43 | ------- 44 | GND | o o | XDATA_RX(PB11) > 1 GND 45 | | | 2 XDATA_RX(PB11) 46 | XDATA_TX(PB10) | o o | +3V_MCU 3 XDATA_TX(PB10) 47 | - | 4 +3V_MCU 48 | V_Boost| o o | VBAT 5 V_Boost 49 | - | 6 VBAT 50 | MCU_RST | o o | SWCLK(PA14) 7 MCU_RST 51 | | | 8 SWCLK(PA14) 52 | SWDIO(PA13) | o o | GND 9 SWDIO(PA13) 53 | ------- 10 GND 54 | 55 | PAY ATTENTION TO THE CUT-OUT 56 | ``` 57 |
58 | 59 | **Note:** The RS41 XDATA connector has a non-standard raster of 2mm, instead of the standard 2.54mm, usually used in standard jumper cables. However, for only 4 wires it should fit inside well and you shouldn't need to buy separate 2mm connectors.
60 | 61 | Using the jumper cables, connect it as follows: 62 | * RS41-**GND** -> STLink-**GND** | RS41-GND is on XDATA pin 1 and 10 63 | * RS41-**SWDCLK** -> STLink-**SWDCLK** | RS41-SWDCLK is on XDATA pin 8; SWDCLK is often named SWCLK or CLK or Clock 64 | * RS41-**SWDIO** -> STLink-**SWDIO** | RS41-SWDIO is on XDATA pin 9; SWDIO is often named SWIO or DIO or Data 65 | * Powering the system: 66 | * If your programmer is capable of supplying **stable 3.3V DC with at least 200mA** of current (most cheap clones are able to): 67 | * **Take out both batteries!** 68 | * Connect: RS41-**+3V_MCU** -> STLink-**+3.3V** | RS41-+3V_MCU is on XDATA pin 4; +3.3V is often named 3.3V or 3v3 69 | * If not, leave both batteries in the place, **don't** connect any power supply to any of the XDATA power pins, and for the upload, power on the sonde by pressing the onboard button. 70 | 71 |
72 | Now your system should be ready to upload the code.
73 | If you encounter any problems at this moment, search in Google for the solution, try to ask AI assistant, and if you don't find the answer, raise an issue (though it should work out of the box). 74 | 75 | 76 | ## Unlocking the factory MCU protection 77 | Factory new sondes with original firmware have read and write protections enabled. Disabling them is only needed once in the sonde's life, to allow the sonde to accept new firmware files. These steps are mandatory for both binary upload and Arduino IDE programming. To disable them, preferably, launch the **STM32CubeProgrammer**: 78 | * In the window, by default you should see something like [this](./photos/main_window.png). 79 | * Now, turn on the sonde, connect it with programmer to the computer and **Select the ST-LINK** as a programmer, then click **connect** [there](./photos/stlink-connection.png). 80 | * Go to **Option bytes** page, and set the following bytes as below: 81 | * For older models (eg. `RSM412`), set like on [this picture](./photos/mcu-unlock-rsm412.png): 82 | * In the **Read Out Protection** 83 | * `RDP byte` to `unchecked` (read out protection disabled) 84 | * In the **Write Protection** 85 | * Set **all** boxes to `unchecked`, the write protection has to be disabled on all sectors. 86 | * For newer models (eg. `RSM414`, `RSM424`), set like on [this picture](./photos/mcu-unlock-rsm414.png): 87 | * In the **Read Out Protection** 88 | * `RDP byte` to `AA` 89 | * In the **Write Protection** 90 | * `WRP1A_STRT` - **value** `0x1`, **address** `0x08000800` 91 | * `WRP1A_END` - **value** `0x0`, **address** `0x08000000` 92 | * `WRP1B_STRT` - **value** `0x1`, **address** `0x08000800` 93 | * `WRP1B_END` - **value** `0x0`, **address** `0x08000000` 94 | * And click **Apply** 95 | * Go to **Erasing & Programming** [page](./photos/erase_and_upload.png), and perform a Full Chip Erase. This will fully clear the MCU memory. If you encoutner any more errors mentioning RDP or any access-protection, please check in the available sources and if you don't know how to resolve it, make an issue there. 96 | * Now your MCU should be **unlocked and ready** to be reprogrammed! 97 | 98 | ## Uploading the pre-compiled binary 99 | * Start-up the STM32CubeProgrammer. It's not the fastest thing in the world, so wait a second. 100 | * In the window, by default you should see something like [this](./photos/main_window.png). 101 | * Now, turn on the sonde, connect it with programmer to the computer and **Select the ST-LINK** as a programmer, then click **connect** [there](./photos/stlink-connection.png). 102 | * Go to **Erasing & Programming** [page](./photos/erase_and_upload.png), and perform a Full Chip Erase. This will clear the MCU and all protections. If you encoutner any errors mentioning RDP or any access-protection, go to third page and make sure any RDP bytes are OFF. 103 | * If you have connected and erased the MCU properly without errors, select your binary file in the File path area (pay attention to the right version for your sonde), then check the **Verify programming** box and make sure that the **Skip flash erase before programming** is *unchecked*. Optionally, you may want the memory checksum, but it isn't needed and works without that. 104 | * If your settings are similiar to the one on the tutorial and the [photo](./photos/erase_and_upload.png), click **Start Programming** button. Now, after a couple of seconds the sonde should run the firmware from the binary. 105 | * Disconnect all the cables, insert batteries and follow the [**Operation manual**](./OPERATION_MANUAL.md). The sonde should remain OFF until you turn it on with the button. 106 | 107 | ## Uploading the Arduino Code 108 | * Download and start-up the Arduino IDE, it should be the new, 2.x version. 109 | * Make sure you followed the [**compilation guide**](./COMPILE.md)!!! 110 | * Open the desired version of the .ino project, available in `./fw-files/` folder. 111 | * Select appropriate board model, this operation is described in the operation manual [here](./OPERATION_MANUAL.md#sonde-pcb-version) 112 | * If you double-checked all the things in the Arduino-IDE and on the hardware-side, connect the programmer to the computer and click upload (CTRL-U). The compilation process takes a while, after this time (look at the progress bar in the corner), you should see the upload progress. After seeing something like *Start application achieved successfully...*, the compiled code should be running on your sonde. If you encoutner any errors targeting flash process, triple check your wiring, selected programmer and every step of this guide. 113 | * Now, you can disconnect all the cables and insert batteries. Then follow the [**Operation manual**](./OPERATION_MANUAL.md). The sonde should remain OFF until you turn it on with the button. 114 | -------------------------------------------------------------------------------- /fw/arduino-ide_variant-files/boards.txt: -------------------------------------------------------------------------------- 1 | # Generic L412RBTxP 2 | GenL4.menu.pnum.GENERIC_L412RBTXP=Generic L412RBTxP 3 | GenL4.menu.pnum.GENERIC_L412RBTXP.upload.maximum_size=131072 4 | GenL4.menu.pnum.GENERIC_L412RBTXP.upload.maximum_data_size=40960 5 | GenL4.menu.pnum.GENERIC_L412RBTXP.build.board=GENERIC_L412RBTXP 6 | GenL4.menu.pnum.GENERIC_L412RBTXP.build.product_line=STM32L412xx 7 | GenL4.menu.pnum.GENERIC_L412RBTXP.build.variant=STM32L4xx/L412RB(I-T)xP 8 | GenL4.menu.pnum.GENERIC_L412RBTXP.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L4xx/STM32L412.svd 9 | -------------------------------------------------------------------------------- /fw/arduino-ide_variant-files/variants/STM32L4xx/L412RB(I-T)xP/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # v3.21 implemented semantic changes regarding $ 2 | # See https://cmake.org/cmake/help/v3.21/command/target_link_libraries.html#linking-object-libraries-via-target-objects 3 | cmake_minimum_required(VERSION 3.21) 4 | 5 | add_library(variant INTERFACE) 6 | add_library(variant_usage INTERFACE) 7 | 8 | target_include_directories(variant_usage INTERFACE 9 | . 10 | ) 11 | 12 | 13 | target_link_libraries(variant_usage INTERFACE 14 | base_config 15 | ) 16 | 17 | target_link_libraries(variant INTERFACE variant_usage) 18 | 19 | 20 | 21 | add_library(variant_bin STATIC EXCLUDE_FROM_ALL 22 | generic_clock.c 23 | PeripheralPins.c 24 | variant_generic.cpp 25 | ) 26 | target_link_libraries(variant_bin PUBLIC variant_usage) 27 | 28 | target_link_libraries(variant INTERFACE 29 | variant_bin 30 | ) 31 | 32 | -------------------------------------------------------------------------------- /fw/arduino-ide_variant-files/variants/STM32L4xx/L412RB(I-T)xP/PeripheralPins.c: -------------------------------------------------------------------------------- 1 | /* 2 | ******************************************************************************* 3 | * Copyright (c) 2020, STMicroelectronics 4 | * All rights reserved. 5 | * 6 | * This software component is licensed by ST under BSD 3-Clause license, 7 | * the "License"; You may not use this file except in compliance with the 8 | * License. You may obtain a copy of the License at: 9 | * opensource.org/licenses/BSD-3-Clause 10 | * 11 | ******************************************************************************* 12 | */ 13 | /* 14 | * Automatically generated from STM32L412RBIxP.xml, STM32L412RBTxP.xml 15 | * CubeMX DB release 6.0.110 16 | */ 17 | #if !defined(CUSTOM_PERIPHERAL_PINS) 18 | #include "Arduino.h" 19 | #include "PeripheralPins.h" 20 | 21 | /* ===== 22 | * Notes: 23 | * - The pins mentioned Px_y_ALTz are alternative possibilities which use other 24 | * HW peripheral instances. You can use them the same way as any other "normal" 25 | * pin (i.e. analogWrite(PA7_ALT1, 128);). 26 | * 27 | * - Commented lines are alternative possibilities which are not used per default. 28 | * If you change them, you will have to know what you do 29 | * ===== 30 | */ 31 | 32 | //*** ADC *** 33 | 34 | #ifdef HAL_ADC_MODULE_ENABLED 35 | WEAK const PinMap PinMap_ADC[] = { 36 | {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5 37 | {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6 38 | {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7 39 | {PA_2_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7 40 | {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8 41 | {PA_3_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_IN8 42 | {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9 43 | {PA_4_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_IN9 44 | {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10 45 | {PA_5_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC2_IN10 46 | {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11 47 | {PA_6_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC2_IN11 48 | {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12 49 | {PA_7_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC2_IN12 50 | {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15 51 | {PB_0_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC2_IN15 52 | {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 16, 0)}, // ADC1_IN16 53 | {PB_1_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 16, 0)}, // ADC2_IN16 54 | {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1 55 | {PC_0_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1 56 | {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 57 | {PC_1_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC2_IN2 58 | {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 59 | {PC_2_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_IN3 60 | {PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4 61 | {PC_3_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4 62 | {PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13 63 | {PC_4_ALT1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC2_IN13 64 | {NC, NP, 0} 65 | }; 66 | #endif 67 | 68 | //*** No DAC *** 69 | 70 | //*** I2C *** 71 | 72 | #ifdef HAL_I2C_MODULE_ENABLED 73 | WEAK const PinMap PinMap_I2C_SDA[] = { 74 | {PA_10, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, 75 | {PB_4, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, 76 | {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, 77 | {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, 78 | {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, 79 | {PB_14, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, 80 | {PC_1, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, 81 | {NC, NP, 0} 82 | }; 83 | #endif 84 | 85 | #ifdef HAL_I2C_MODULE_ENABLED 86 | WEAK const PinMap PinMap_I2C_SCL[] = { 87 | {PA_7, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, 88 | {PA_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, 89 | {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, 90 | {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, 91 | {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, 92 | {PB_13, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, 93 | {PC_0, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)}, 94 | {NC, NP, 0} 95 | }; 96 | #endif 97 | 98 | //*** No I3C *** 99 | 100 | //*** TIM *** 101 | 102 | #ifdef HAL_TIM_MODULE_ENABLED 103 | WEAK const PinMap PinMap_TIM[] = { 104 | {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 105 | {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 106 | {PA_1_ALT1, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM15, 1, 1)}, // TIM15_CH1N 107 | {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 108 | {PA_2_ALT1, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM15, 1, 0)}, // TIM15_CH1 109 | {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 110 | {PA_3_ALT1, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM15, 2, 0)}, // TIM15_CH2 111 | {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 112 | {PA_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM16, 1, 0)}, // TIM16_CH1 113 | {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N 114 | {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1 115 | {PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2 116 | {PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3 117 | {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4 118 | {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 119 | {PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N 120 | {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N 121 | {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 122 | {PB_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM16, 1, 1)}, // TIM16_CH1N 123 | {PB_8, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM16, 1, 0)}, // TIM16_CH1 124 | {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 125 | {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 126 | {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N 127 | {PB_13_ALT1, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM15, 1, 1)}, // TIM15_CH1N 128 | {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N 129 | {PB_14_ALT1, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM15, 1, 0)}, // TIM15_CH1 130 | {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N 131 | {PB_15_ALT1, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM15, 2, 0)}, // TIM15_CH2 132 | {NC, NP, 0} 133 | }; 134 | #endif 135 | 136 | //*** UART *** 137 | 138 | #ifdef HAL_UART_MODULE_ENABLED 139 | WEAK const PinMap PinMap_UART_TX[] = { 140 | {PA_2, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, 141 | {PA_2_ALT1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, 142 | {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, 143 | {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, 144 | {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, 145 | {PB_11, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, 146 | {PC_1, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, 147 | {PC_4, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, 148 | {PC_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, 149 | {NC, NP, 0} 150 | }; 151 | #endif 152 | 153 | #ifdef HAL_UART_MODULE_ENABLED 154 | WEAK const PinMap PinMap_UART_RX[] = { 155 | {PA_3, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, 156 | {PA_3_ALT1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, 157 | {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, 158 | {PA_15, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_USART2)}, 159 | {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, 160 | {PB_10, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, 161 | {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, 162 | {PC_0, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, 163 | {PC_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, 164 | {NC, NP, 0} 165 | }; 166 | #endif 167 | 168 | #ifdef HAL_UART_MODULE_ENABLED 169 | WEAK const PinMap PinMap_UART_RTS[] = { 170 | {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, 171 | {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, 172 | {PA_15, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, 173 | {PB_1, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, 174 | {PB_1_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, 175 | {PB_3, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, 176 | {PB_12, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, 177 | {PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, 178 | {NC, NP, 0} 179 | }; 180 | #endif 181 | 182 | #ifdef HAL_UART_MODULE_ENABLED 183 | WEAK const PinMap PinMap_UART_CTS[] = { 184 | {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, 185 | {PA_6, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, 186 | {PA_6_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, 187 | {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, 188 | {PB_4, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, 189 | {PB_13, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, 190 | {PB_13_ALT1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, 191 | {NC, NP, 0} 192 | }; 193 | #endif 194 | 195 | //*** SPI *** 196 | 197 | #ifdef HAL_SPI_MODULE_ENABLED 198 | WEAK const PinMap PinMap_SPI_MOSI[] = { 199 | {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, 200 | {PA_12, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, 201 | {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, 202 | {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, 203 | {PC_3, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, 204 | {NC, NP, 0} 205 | }; 206 | #endif 207 | 208 | #ifdef HAL_SPI_MODULE_ENABLED 209 | WEAK const PinMap PinMap_SPI_MISO[] = { 210 | {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, 211 | {PA_11, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, 212 | {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, 213 | {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, 214 | {PC_2, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, 215 | {NC, NP, 0} 216 | }; 217 | #endif 218 | 219 | #ifdef HAL_SPI_MODULE_ENABLED 220 | WEAK const PinMap PinMap_SPI_SCLK[] = { 221 | {PA_1, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, 222 | {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, 223 | {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, 224 | {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, 225 | {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, 226 | {NC, NP, 0} 227 | }; 228 | #endif 229 | 230 | #ifdef HAL_SPI_MODULE_ENABLED 231 | WEAK const PinMap PinMap_SPI_SSEL[] = { 232 | {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, 233 | {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, 234 | {PB_0, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, 235 | {PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, 236 | {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, 237 | {NC, NP, 0} 238 | }; 239 | #endif 240 | 241 | //*** No CAN *** 242 | 243 | //*** No ETHERNET *** 244 | 245 | //*** QUADSPI *** 246 | 247 | #ifdef HAL_QSPI_MODULE_ENABLED 248 | WEAK const PinMap PinMap_QUADSPI_DATA0[] = { 249 | {PB_1, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK1_IO0 250 | {NC, NP, 0} 251 | }; 252 | #endif 253 | 254 | #ifdef HAL_QSPI_MODULE_ENABLED 255 | WEAK const PinMap PinMap_QUADSPI_DATA1[] = { 256 | {PB_0, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK1_IO1 257 | {NC, NP, 0} 258 | }; 259 | #endif 260 | 261 | #ifdef HAL_QSPI_MODULE_ENABLED 262 | WEAK const PinMap PinMap_QUADSPI_DATA2[] = { 263 | {PA_7, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK1_IO2 264 | {NC, NP, 0} 265 | }; 266 | #endif 267 | 268 | #ifdef HAL_QSPI_MODULE_ENABLED 269 | WEAK const PinMap PinMap_QUADSPI_DATA3[] = { 270 | {PA_6, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK1_IO3 271 | {NC, NP, 0} 272 | }; 273 | #endif 274 | 275 | #ifdef HAL_QSPI_MODULE_ENABLED 276 | WEAK const PinMap PinMap_QUADSPI_SCLK[] = { 277 | {PA_3, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_CLK 278 | {PB_10, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_CLK 279 | {NC, NP, 0} 280 | }; 281 | #endif 282 | 283 | #ifdef HAL_QSPI_MODULE_ENABLED 284 | WEAK const PinMap PinMap_QUADSPI_SSEL[] = { 285 | {PA_2, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK1_NCS 286 | {PB_11, QUADSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_QUADSPI)}, // QUADSPI_BK1_NCS 287 | {NC, NP, 0} 288 | }; 289 | #endif 290 | 291 | //*** USB *** 292 | 293 | #if defined(HAL_PCD_MODULE_ENABLED) || defined(HAL_HCD_MODULE_ENABLED) 294 | WEAK const PinMap PinMap_USB[] = { 295 | {PA_11, USB, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_USB_FS)}, // USB_DM 296 | {PA_12, USB, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_USB_FS)}, // USB_DP 297 | {PA_13, USB, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_USB_FS)}, // USB_NOE 298 | {PC_9, USB, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_USB_FS)}, // USB_NOE 299 | {NC, NP, 0} 300 | }; 301 | #endif 302 | 303 | //*** No SD *** 304 | 305 | #endif /* !CUSTOM_PERIPHERAL_PINS */ 306 | -------------------------------------------------------------------------------- /fw/arduino-ide_variant-files/variants/STM32L4xx/L412RB(I-T)xP/PinNamesVar.h: -------------------------------------------------------------------------------- 1 | /* Alternate pin name */ 2 | PA_1_ALT1 = PA_1 | ALT1, 3 | PA_2_ALT1 = PA_2 | ALT1, 4 | PA_3_ALT1 = PA_3 | ALT1, 5 | PA_4_ALT1 = PA_4 | ALT1, 6 | PA_5_ALT1 = PA_5 | ALT1, 7 | PA_6_ALT1 = PA_6 | ALT1, 8 | PA_7_ALT1 = PA_7 | ALT1, 9 | PB_0_ALT1 = PB_0 | ALT1, 10 | PB_1_ALT1 = PB_1 | ALT1, 11 | PB_13_ALT1 = PB_13 | ALT1, 12 | PB_14_ALT1 = PB_14 | ALT1, 13 | PB_15_ALT1 = PB_15 | ALT1, 14 | PC_0_ALT1 = PC_0 | ALT1, 15 | PC_1_ALT1 = PC_1 | ALT1, 16 | PC_2_ALT1 = PC_2 | ALT1, 17 | PC_3_ALT1 = PC_3 | ALT1, 18 | PC_4_ALT1 = PC_4 | ALT1, 19 | 20 | /* SYS_WKUP */ 21 | #ifdef PWR_WAKEUP_PIN1 22 | SYS_WKUP1 = PA_0, 23 | #endif 24 | #ifdef PWR_WAKEUP_PIN2 25 | SYS_WKUP2 = PC_13, 26 | #endif 27 | #ifdef PWR_WAKEUP_PIN3 28 | SYS_WKUP3 = NC, 29 | #endif 30 | #ifdef PWR_WAKEUP_PIN4 31 | SYS_WKUP4 = PA_2, 32 | #endif 33 | #ifdef PWR_WAKEUP_PIN5 34 | SYS_WKUP5 = NC, 35 | #endif 36 | #ifdef PWR_WAKEUP_PIN6 37 | SYS_WKUP6 = NC, 38 | #endif 39 | #ifdef PWR_WAKEUP_PIN7 40 | SYS_WKUP7 = NC, 41 | #endif 42 | #ifdef PWR_WAKEUP_PIN8 43 | SYS_WKUP8 = NC, 44 | #endif 45 | 46 | /* USB */ 47 | #ifdef USBCON 48 | USB_DM = PA_11, 49 | USB_DP = PA_12, 50 | #ifdef USB_NOE_PA_13 51 | USB_NOE = PA_13, 52 | #endif 53 | #ifdef USB_NOE_PC_9 54 | USB_NOE = PC_9, 55 | #endif 56 | #endif 57 | -------------------------------------------------------------------------------- /fw/arduino-ide_variant-files/variants/STM32L4xx/L412RB(I-T)xP/boards_entry.txt: -------------------------------------------------------------------------------- 1 | # This file help to add generic board entry. 2 | # upload.maximum_size and product_line have to be verified 3 | # and changed if needed. 4 | # See: https://github.com/stm32duino/Arduino_Core_STM32/wiki/Add-a-new-variant-%28board%29 5 | 6 | # Generic L412RBIxP 7 | GenL4.menu.pnum.GENERIC_L412RBIXP=Generic L412RBIxP 8 | GenL4.menu.pnum.GENERIC_L412RBIXP.upload.maximum_size=131072 9 | GenL4.menu.pnum.GENERIC_L412RBIXP.upload.maximum_data_size=40960 10 | GenL4.menu.pnum.GENERIC_L412RBIXP.build.board=GENERIC_L412RBIXP 11 | GenL4.menu.pnum.GENERIC_L412RBIXP.build.product_line=STM32L412xx 12 | GenL4.menu.pnum.GENERIC_L412RBIXP.build.variant=STM32L4xx/L412RB(I-T)xP 13 | GenL4.menu.pnum.GENERIC_L412RBIXP.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L4xx/STM32L412.svd 14 | 15 | # Generic L412RBTxP 16 | GenL4.menu.pnum.GENERIC_L412RBTXP=Generic L412RBTxP 17 | GenL4.menu.pnum.GENERIC_L412RBTXP.upload.maximum_size=131072 18 | GenL4.menu.pnum.GENERIC_L412RBTXP.upload.maximum_data_size=40960 19 | GenL4.menu.pnum.GENERIC_L412RBTXP.build.board=GENERIC_L412RBTXP 20 | GenL4.menu.pnum.GENERIC_L412RBTXP.build.product_line=STM32L412xx 21 | GenL4.menu.pnum.GENERIC_L412RBTXP.build.variant=STM32L4xx/L412RB(I-T)xP 22 | GenL4.menu.pnum.GENERIC_L412RBTXP.debug.svd_file={runtime.tools.STM32_SVD.path}/svd/STM32L4xx/STM32L412.svd 23 | 24 | -------------------------------------------------------------------------------- /fw/arduino-ide_variant-files/variants/STM32L4xx/L412RB(I-T)xP/generic_clock.c: -------------------------------------------------------------------------------- 1 | /* 2 | ******************************************************************************* 3 | * Copyright (c) 2020-2021, STMicroelectronics 4 | * All rights reserved. 5 | * 6 | * This software component is licensed by ST under BSD 3-Clause license, 7 | * the "License"; You may not use this file except in compliance with the 8 | * License. You may obtain a copy of the License at: 9 | * opensource.org/licenses/BSD-3-Clause 10 | * 11 | ******************************************************************************* 12 | */ 13 | #if defined(ARDUINO_GENERIC_L412RBIXP) || defined(ARDUINO_GENERIC_L412RBTXP) 14 | #include "pins_arduino.h" 15 | 16 | /** 17 | * @brief System Clock Configuration 18 | * @param None 19 | * @retval None 20 | */ 21 | WEAK void SystemClock_Config(void) 22 | { 23 | RCC_OscInitTypeDef RCC_OscInitStruct = {}; 24 | RCC_ClkInitTypeDef RCC_ClkInitStruct = {}; 25 | 26 | /** Configure the main internal regulator output voltage 27 | */ 28 | if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1) != HAL_OK) 29 | { 30 | Error_Handler(); 31 | } 32 | 33 | /** Initializes the RCC Oscillators according to the specified parameters 34 | * in the RCC_OscInitTypeDef structure. 35 | */ 36 | RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; 37 | RCC_OscInitStruct.HSIState = RCC_HSI_ON; 38 | RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; 39 | RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; 40 | RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; 41 | RCC_OscInitStruct.PLL.PLLM = 1; 42 | RCC_OscInitStruct.PLL.PLLN = 10; 43 | RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2; 44 | RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2; 45 | if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) 46 | { 47 | Error_Handler(); 48 | } 49 | 50 | /** Initializes the CPU, AHB and APB buses clocks 51 | */ 52 | RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK 53 | |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; 54 | RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; 55 | RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; 56 | RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; 57 | RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; 58 | 59 | if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4) != HAL_OK) 60 | { 61 | Error_Handler(); 62 | } 63 | } 64 | 65 | #endif /* ARDUINO_GENERIC_* */ 66 | -------------------------------------------------------------------------------- /fw/arduino-ide_variant-files/variants/STM32L4xx/L412RB(I-T)xP/ldscript.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ****************************************************************************** 3 | ** 4 | ** @file : LinkerScript.ld 5 | ** 6 | ** @author : Auto-generated by STM32CubeIDE 7 | ** 8 | ** @brief : Linker script for STM32L412RBTx Device from STM32L4 series 9 | ** 128KBytes FLASH 10 | ** 40KBytes RAM 11 | ** 8KBytes RAM2 12 | ** 13 | ** Set heap size, stack size and stack location according 14 | ** to application requirements. 15 | ** 16 | ** Set memory bank area and size if external memory is used 17 | ** 18 | ** Target : STMicroelectronics STM32 19 | ** 20 | ** Distribution: The file is distributed as is, without any warranty 21 | ** of any kind. 22 | ** 23 | ****************************************************************************** 24 | ** @attention 25 | ** 26 | ** Copyright (c) 2024 STMicroelectronics. 27 | ** All rights reserved. 28 | ** 29 | ** This software is licensed under terms that can be found in the LICENSE file 30 | ** in the root directory of this software component. 31 | ** If no LICENSE file comes with this software, it is provided AS-IS. 32 | ** 33 | ****************************************************************************** 34 | */ 35 | 36 | /* Entry Point */ 37 | ENTRY(Reset_Handler) 38 | 39 | /* Highest address of the user mode stack */ 40 | _estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ 41 | 42 | _Min_Heap_Size = 0x200; /* required amount of heap */ 43 | _Min_Stack_Size = 0x400; /* required amount of stack */ 44 | 45 | /* Memories definition */ 46 | MEMORY 47 | { 48 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE 49 | RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 8K 50 | FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET 51 | } 52 | 53 | /* Sections */ 54 | SECTIONS 55 | { 56 | /* The startup code into "FLASH" Rom type memory */ 57 | .isr_vector : 58 | { 59 | . = ALIGN(4); 60 | KEEP(*(.isr_vector)) /* Startup code */ 61 | . = ALIGN(4); 62 | } >FLASH 63 | 64 | /* The program code and other data into "FLASH" Rom type memory */ 65 | .text : 66 | { 67 | . = ALIGN(4); 68 | *(.text) /* .text sections (code) */ 69 | *(.text*) /* .text* sections (code) */ 70 | *(.glue_7) /* glue arm to thumb code */ 71 | *(.glue_7t) /* glue thumb to arm code */ 72 | *(.eh_frame) 73 | 74 | KEEP (*(.init)) 75 | KEEP (*(.fini)) 76 | 77 | . = ALIGN(4); 78 | _etext = .; /* define a global symbols at end of code */ 79 | } >FLASH 80 | 81 | /* Constant data into "FLASH" Rom type memory */ 82 | .rodata : 83 | { 84 | . = ALIGN(4); 85 | *(.rodata) /* .rodata sections (constants, strings, etc.) */ 86 | *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ 87 | . = ALIGN(4); 88 | } >FLASH 89 | 90 | .ARM.extab (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */ 91 | { 92 | . = ALIGN(4); 93 | *(.ARM.extab* .gnu.linkonce.armextab.*) 94 | . = ALIGN(4); 95 | } >FLASH 96 | 97 | .ARM (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */ 98 | { 99 | . = ALIGN(4); 100 | __exidx_start = .; 101 | *(.ARM.exidx*) 102 | __exidx_end = .; 103 | . = ALIGN(4); 104 | } >FLASH 105 | 106 | .preinit_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */ 107 | { 108 | . = ALIGN(4); 109 | PROVIDE_HIDDEN (__preinit_array_start = .); 110 | KEEP (*(.preinit_array*)) 111 | PROVIDE_HIDDEN (__preinit_array_end = .); 112 | . = ALIGN(4); 113 | } >FLASH 114 | 115 | .init_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */ 116 | { 117 | . = ALIGN(4); 118 | PROVIDE_HIDDEN (__init_array_start = .); 119 | KEEP (*(SORT(.init_array.*))) 120 | KEEP (*(.init_array*)) 121 | PROVIDE_HIDDEN (__init_array_end = .); 122 | . = ALIGN(4); 123 | } >FLASH 124 | 125 | .fini_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */ 126 | { 127 | . = ALIGN(4); 128 | PROVIDE_HIDDEN (__fini_array_start = .); 129 | KEEP (*(SORT(.fini_array.*))) 130 | KEEP (*(.fini_array*)) 131 | PROVIDE_HIDDEN (__fini_array_end = .); 132 | . = ALIGN(4); 133 | } >FLASH 134 | 135 | /* Used by the startup to initialize data */ 136 | _sidata = LOADADDR(.data); 137 | 138 | /* Initialized data sections into "RAM" Ram type memory */ 139 | .data : 140 | { 141 | . = ALIGN(4); 142 | _sdata = .; /* create a global symbol at data start */ 143 | *(.data) /* .data sections */ 144 | *(.data*) /* .data* sections */ 145 | *(.RamFunc) /* .RamFunc sections */ 146 | *(.RamFunc*) /* .RamFunc* sections */ 147 | 148 | . = ALIGN(4); 149 | _edata = .; /* define a global symbol at data end */ 150 | 151 | } >RAM AT> FLASH 152 | 153 | /* Uninitialized data section into "RAM" Ram type memory */ 154 | . = ALIGN(4); 155 | .bss : 156 | { 157 | /* This is used by the startup in order to initialize the .bss section */ 158 | _sbss = .; /* define a global symbol at bss start */ 159 | __bss_start__ = _sbss; 160 | *(.bss) 161 | *(.bss*) 162 | *(COMMON) 163 | 164 | . = ALIGN(4); 165 | _ebss = .; /* define a global symbol at bss end */ 166 | __bss_end__ = _ebss; 167 | } >RAM 168 | 169 | /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ 170 | ._user_heap_stack : 171 | { 172 | . = ALIGN(8); 173 | PROVIDE ( end = . ); 174 | PROVIDE ( _end = . ); 175 | . = . + _Min_Heap_Size; 176 | . = . + _Min_Stack_Size; 177 | . = ALIGN(8); 178 | } >RAM 179 | 180 | /* Remove information from the compiler libraries */ 181 | /DISCARD/ : 182 | { 183 | libc.a ( * ) 184 | libm.a ( * ) 185 | libgcc.a ( * ) 186 | } 187 | 188 | .ARM.attributes 0 : { *(.ARM.attributes) } 189 | } 190 | -------------------------------------------------------------------------------- /fw/arduino-ide_variant-files/variants/STM32L4xx/L412RB(I-T)xP/variant_generic.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ******************************************************************************* 3 | * Copyright (c) 2020, STMicroelectronics 4 | * All rights reserved. 5 | * 6 | * This software component is licensed by ST under BSD 3-Clause license, 7 | * the "License"; You may not use this file except in compliance with the 8 | * License. You may obtain a copy of the License at: 9 | * opensource.org/licenses/BSD-3-Clause 10 | * 11 | ******************************************************************************* 12 | */ 13 | #if defined(ARDUINO_GENERIC_L412RBIXP) || defined(ARDUINO_GENERIC_L412RBTXP) 14 | #include "pins_arduino.h" 15 | 16 | // Digital PinName array 17 | const PinName digitalPin[] = { 18 | PA_0, // D0/A0 19 | PA_1, // D1/A1 20 | PA_2, // D2/A2 21 | PA_3, // D3/A3 22 | PA_4, // D4/A4 23 | PA_5, // D5/A5 24 | PA_6, // D6/A6 25 | PA_7, // D7/A7 26 | PA_8, // D8 27 | PA_9, // D9 28 | PA_10, // D10 29 | PA_11, // D11 30 | PA_12, // D12 31 | PA_13, // D13 32 | PA_14, // D14 33 | PA_15, // D15 34 | PB_0, // D16/A8 35 | PB_1, // D17/A9 36 | PB_2, // D18 37 | PB_3, // D19 38 | PB_4, // D20 39 | PB_5, // D21 40 | PB_6, // D22 41 | PB_7, // D23 42 | PB_8, // D24 43 | PB_9, // D25 44 | PB_10, // D26 45 | PB_11, // D27 46 | PB_12, // D28 47 | PB_13, // D29 48 | PB_14, // D30 49 | PB_15, // D31 50 | PC_0, // D32/A10 51 | PC_1, // D33/A11 52 | PC_2, // D34/A12 53 | PC_3, // D35/A13 54 | PC_4, // D36/A14 55 | PC_6, // D37 56 | PC_7, // D38 57 | PC_8, // D39 58 | PC_9, // D40 59 | PC_10, // D41 60 | PC_11, // D42 61 | PC_12, // D43 62 | PC_13, // D44 63 | PC_14, // D45 64 | PC_15, // D46 65 | PH_0, // D47 66 | PH_1, // D48 67 | PH_3 // D49 68 | }; 69 | 70 | // Analog (Ax) pin number array 71 | const uint32_t analogInputPin[] = { 72 | 0, // A0, PA0 73 | 1, // A1, PA1 74 | 2, // A2, PA2 75 | 3, // A3, PA3 76 | 4, // A4, PA4 77 | 5, // A5, PA5 78 | 6, // A6, PA6 79 | 7, // A7, PA7 80 | 16, // A8, PB0 81 | 17, // A9, PB1 82 | 32, // A10, PC0 83 | 33, // A11, PC1 84 | 34, // A12, PC2 85 | 35, // A13, PC3 86 | 36 // A14, PC4 87 | }; 88 | 89 | #endif /* ARDUINO_GENERIC_* */ 90 | -------------------------------------------------------------------------------- /fw/arduino-ide_variant-files/variants/STM32L4xx/L412RB(I-T)xP/variant_generic.h: -------------------------------------------------------------------------------- 1 | /* 2 | ******************************************************************************* 3 | * Copyright (c) 2020, STMicroelectronics 4 | * All rights reserved. 5 | * 6 | * This software component is licensed by ST under BSD 3-Clause license, 7 | * the "License"; You may not use this file except in compliance with the 8 | * License. You may obtain a copy of the License at: 9 | * opensource.org/licenses/BSD-3-Clause 10 | * 11 | ******************************************************************************* 12 | */ 13 | #pragma once 14 | 15 | /*---------------------------------------------------------------------------- 16 | * STM32 pins number 17 | *----------------------------------------------------------------------------*/ 18 | #define PA0 PIN_A0 19 | #define PA1 PIN_A1 20 | #define PA2 PIN_A2 21 | #define PA3 PIN_A3 22 | #define PA4 PIN_A4 23 | #define PA5 PIN_A5 24 | #define PA6 PIN_A6 25 | #define PA7 PIN_A7 26 | #define PA8 8 27 | #define PA9 9 28 | #define PA10 10 29 | #define PA11 11 30 | #define PA12 12 31 | #define PA13 13 32 | #define PA14 14 33 | #define PA15 15 34 | #define PB0 PIN_A8 35 | #define PB1 PIN_A9 36 | #define PB2 18 37 | #define PB3 19 38 | #define PB4 20 39 | #define PB5 21 40 | #define PB6 22 41 | #define PB7 23 42 | #define PB8 24 43 | #define PB9 25 44 | #define PB10 26 45 | #define PB11 27 46 | #define PB12 28 47 | #define PB13 29 48 | #define PB14 30 49 | #define PB15 31 50 | #define PC0 PIN_A10 51 | #define PC1 PIN_A11 52 | #define PC2 PIN_A12 53 | #define PC3 PIN_A13 54 | #define PC4 PIN_A14 55 | #define PC6 37 56 | #define PC7 38 57 | #define PC8 39 58 | #define PC9 40 59 | #define PC10 41 60 | #define PC11 42 61 | #define PC12 43 62 | #define PC13 44 63 | #define PC14 45 64 | #define PC15 46 65 | #define PH0 47 66 | #define PH1 48 67 | #define PH3 49 68 | 69 | // Alternate pins number 70 | #define PA1_ALT1 (PA1 | ALT1) 71 | #define PA2_ALT1 (PA2 | ALT1) 72 | #define PA3_ALT1 (PA3 | ALT1) 73 | #define PA4_ALT1 (PA4 | ALT1) 74 | #define PA5_ALT1 (PA5 | ALT1) 75 | #define PA6_ALT1 (PA6 | ALT1) 76 | #define PA7_ALT1 (PA7 | ALT1) 77 | #define PB0_ALT1 (PB0 | ALT1) 78 | #define PB1_ALT1 (PB1 | ALT1) 79 | #define PB13_ALT1 (PB13 | ALT1) 80 | #define PB14_ALT1 (PB14 | ALT1) 81 | #define PB15_ALT1 (PB15 | ALT1) 82 | #define PC0_ALT1 (PC0 | ALT1) 83 | #define PC1_ALT1 (PC1 | ALT1) 84 | #define PC2_ALT1 (PC2 | ALT1) 85 | #define PC3_ALT1 (PC3 | ALT1) 86 | #define PC4_ALT1 (PC4 | ALT1) 87 | 88 | #define NUM_DIGITAL_PINS 50 89 | #define NUM_ANALOG_INPUTS 15 90 | 91 | // On-board LED pin number 92 | #ifndef LED_BUILTIN 93 | #define LED_BUILTIN PNUM_NOT_DEFINED 94 | #endif 95 | 96 | // On-board user button 97 | #ifndef USER_BTN 98 | #define USER_BTN PNUM_NOT_DEFINED 99 | #endif 100 | 101 | // SPI definitions 102 | #ifndef PIN_SPI_SS 103 | #define PIN_SPI_SS PA4 104 | #endif 105 | #ifndef PIN_SPI_SS1 106 | #define PIN_SPI_SS1 PA15 107 | #endif 108 | #ifndef PIN_SPI_SS2 109 | #define PIN_SPI_SS2 PB0 110 | #endif 111 | #ifndef PIN_SPI_SS3 112 | #define PIN_SPI_SS3 PNUM_NOT_DEFINED 113 | #endif 114 | #ifndef PIN_SPI_MOSI 115 | #define PIN_SPI_MOSI PA7 116 | #endif 117 | #ifndef PIN_SPI_MISO 118 | #define PIN_SPI_MISO PA6 119 | #endif 120 | #ifndef PIN_SPI_SCK 121 | #define PIN_SPI_SCK PA1 122 | #endif 123 | 124 | // I2C definitions 125 | #ifndef PIN_WIRE_SDA 126 | #define PIN_WIRE_SDA PA10 127 | #endif 128 | #ifndef PIN_WIRE_SCL 129 | #define PIN_WIRE_SCL PA9 130 | #endif 131 | 132 | // Timer Definitions 133 | // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin 134 | #ifndef TIMER_TONE 135 | #define TIMER_TONE TIM6 136 | #endif 137 | #ifndef TIMER_SERVO 138 | #define TIMER_SERVO TIM16 139 | #endif 140 | 141 | // UART Definitions 142 | #ifndef SERIAL_UART_INSTANCE 143 | #define SERIAL_UART_INSTANCE 101 144 | #endif 145 | 146 | // Default pin used for generic 'Serial' instance 147 | // Mandatory for Firmata 148 | #ifndef PIN_SERIAL_RX 149 | #define PIN_SERIAL_RX PA3 150 | #endif 151 | #ifndef PIN_SERIAL_TX 152 | #define PIN_SERIAL_TX PA2 153 | #endif 154 | 155 | // Extra HAL modules 156 | #if !defined(HAL_QSPI_MODULE_DISABLED) 157 | #define HAL_QSPI_MODULE_ENABLED 158 | #endif 159 | 160 | /*---------------------------------------------------------------------------- 161 | * Arduino objects - C++ only 162 | *----------------------------------------------------------------------------*/ 163 | 164 | #ifdef __cplusplus 165 | // These serial port names are intended to allow libraries and architecture-neutral 166 | // sketches to automatically default to the correct port name for a particular type 167 | // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, 168 | // the first hardware serial port whose RX/TX pins are not dedicated to another use. 169 | // 170 | // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor 171 | // 172 | // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial 173 | // 174 | // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library 175 | // 176 | // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. 177 | // 178 | // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX 179 | // pins are NOT connected to anything by default. 180 | #ifndef SERIAL_PORT_MONITOR 181 | #define SERIAL_PORT_MONITOR Serial 182 | #endif 183 | #ifndef SERIAL_PORT_HARDWARE 184 | #define SERIAL_PORT_HARDWARE Serial 185 | #endif 186 | #endif 187 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v20/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v20/v20-default.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v20/v20-default.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v21/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v21/v21-default-rsm4x2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v21/v21-default-rsm4x2.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v21/v21-default-rsm4x4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v21/v21-default-rsm4x4.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v22/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v22/v22-default-rsm4x4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v22/v22-default-rsm4x4.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v23/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v23/v23-default-rsm4x2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v23/v23-default-rsm4x2.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v23/v23-default-rsm4x4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v23/v23-default-rsm4x4.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v231/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v231/v231-default-rsm4x4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v231/v231-default-rsm4x4.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v24/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v24/v24-default-rsm4x4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v24/v24-default-rsm4x4.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v25/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v25/v25-default-rsm4x4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v25/v25-default-rsm4x4.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v26/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v26/v26-default-rsm4x2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v26/v26-default-rsm4x2.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v26/v26-default-rsm4x4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v26/v26-default-rsm4x4.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v27/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v27/v27-default-rsm4x2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v27/v27-default-rsm4x2.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v27/v27-default-rsm4x4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v27/v27-default-rsm4x4.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v28/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v28/v28-default-rsm4x2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v28/v28-default-rsm4x2.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v28/v28-default-rsm4x4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v28/v28-default-rsm4x4.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v29/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v29/v29-default-rsm4x2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v29/v29-default-rsm4x2.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v29/v29-default-rsm4x4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v29/v29-default-rsm4x4.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v30/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v30/v30-default-rsm4x2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v30/v30-default-rsm4x2.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v30/v30-default-rsm4x4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v30/v30-default-rsm4x4.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v31/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v31/v31-default-rsm4x2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v31/v31-default-rsm4x2.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v31/v31-default-rsm4x4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v31/v31-default-rsm4x4.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v32/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v32/v32-default-rsm4x2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v32/v32-default-rsm4x2.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v32/v32-default-rsm4x4.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/fw-files/old-structure/rs41-nfw_v32/v32-default-rsm4x4.bin -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v33/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v34/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v35/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v36/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v37/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v38/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v39/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v40/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v41/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v42/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v43/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v44/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v45/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v46/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v47/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v48/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v49/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v50/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v51/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v52/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v53/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/old-structure/rs41-nfw_v54/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/fw-files/rs41-nfw/horus_l2.cpp: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.c 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | Horus telemetry layer 2 processing. Takes an array of 8 bit payload 8 | data, generates parity bits for a (23,12) Golay code, interleaves 9 | data and parity bits, pre-pends a Unique Word for modem sync. 10 | Caller is responsible for providing storage for output packet. 11 | 12 | [ ] code based interleaver 13 | [ ] test correction of 1,2 & 3 error patterms 14 | 15 | 1/ Unit test on a PC: 16 | 17 | $ gcc horus_l2.c -o horus_l2 -Wall -DHORUS_L2_UNITTEST 18 | $ ./horus_l2 19 | 20 | test 0: 22 bytes of payload data BER: 0.00 errors: 0 21 | test 0: 22 bytes of payload data BER: 0.01 errors: 0 22 | test 0: 22 bytes of payload data BER: 0.05 errors: 0 23 | test 0: 22 bytes of payload data BER: 0.10 errors: 7 24 | 25 | This indicates it's correcting all channel errors for 22 bytes of 26 | payload data, at bit error rate (BER) of 0, 0.01, 0.05. It falls 27 | over at a BER of 0.10 which is expected. 28 | 29 | 2/ To build with just the tx function, ie for linking with the payload 30 | firmware: 31 | 32 | $ gcc horus_l2.c -c -Wall 33 | 34 | By default the RX side is #ifdef-ed out, leaving the minimal amount 35 | of code for tx. 36 | 37 | 3/ Generate some tx_bits as input for testing with fsk_horus: 38 | 39 | $ gcc horus_l2.c -o horus_l2 -Wall -DGEN_TX_BITS -DSCRAMBLER 40 | $ ./horus_l2 41 | $ more ../octave/horus_tx_bits_binary.txt 42 | 43 | 4/ Unit testing interleaver: 44 | 45 | $ gcc horus_l2.c -o horus_l2 -Wall -DINTERLEAVER -DTEST_INTERLEAVER -DSCRAMBLER 46 | 47 | 5/ Compile for use as decoder called by fsk_horus.m and fsk_horus_stream.m: 48 | 49 | $ gcc horus_l2.c -o horus_l2 -Wall -DDEC_RX_BITS -DHORUS_L2_RX 50 | 51 | \*---------------------------------------------------------------------------*/ 52 | 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | #include "horus_l2.h" 59 | 60 | #ifdef HORUS_L2_UNITTEST 61 | #define HORUS_L2_RX 62 | #endif 63 | 64 | #define RUN_TIME_TABLES 65 | 66 | #define INTERLEAVER 67 | #define SCRAMBLER 68 | 69 | static char uw[] = {'$','$'}; 70 | 71 | /* Function Prototypes ------------------------------------------------*/ 72 | 73 | int32_t get_syndrome(int32_t pattern); 74 | void golay23_init(void); 75 | int golay23_decode(int received_codeword); 76 | unsigned short gen_crc16(unsigned char* data_p, unsigned char length); 77 | void interleave(unsigned char *inout, int nbytes, int dir); 78 | void scramble(unsigned char *inout, int nbytes); 79 | 80 | /* Functions ----------------------------------------------------------*/ 81 | 82 | /* 83 | We are using a Golay (23,12) code which has a codeword 23 bits 84 | long. The tx packet format is: 85 | 86 | | Unique Word | payload data bits | parity bits | 87 | 88 | This function works out how much storage the caller of 89 | horus_l2_encode_tx_packet() will need to store the tx packet 90 | */ 91 | 92 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes) { 93 | int num_payload_data_bits, num_golay_codewords; 94 | int num_tx_data_bits, num_tx_data_bytes; 95 | 96 | num_payload_data_bits = num_payload_data_bytes*8; 97 | num_golay_codewords = num_payload_data_bits/12; 98 | if (num_payload_data_bits % 12) /* round up to 12 bits, may mean some unused bits */ 99 | num_golay_codewords++; 100 | 101 | num_tx_data_bits = sizeof(uw)*8 + num_payload_data_bits + num_golay_codewords*11; 102 | num_tx_data_bytes = num_tx_data_bits/8; 103 | if (num_tx_data_bits % 8) /* round up to nearest byte, may mean some unused bits */ 104 | num_tx_data_bytes++; 105 | 106 | #ifdef DEBUG0 107 | fprintf(stderr, "\nnum_payload_data_bytes: %d\n", num_payload_data_bytes); 108 | fprintf(stderr, "num_golay_codewords...: %d\n", num_golay_codewords); 109 | fprintf(stderr, "num_tx_data_bits......: %d\n", num_tx_data_bits); 110 | fprintf(stderr, "num_tx_data_bytes.....: %d\n\n", num_tx_data_bytes); 111 | #endif 112 | 113 | return num_tx_data_bytes; 114 | } 115 | 116 | 117 | /* 118 | Takes an array of payload data bytes, prepends a unique word and appends 119 | parity bits. 120 | 121 | The encoder will run on the payload on a small 8-bit uC. As we are 122 | memory constrained so we do a lot of burrowing for bits out of 123 | packed arrays, and don't use a LUT for Golay encoding. Hopefully it 124 | will run fast enough. This was quite difficult to get going, 125 | suspect there is a better way to write this. Oh well, have to start 126 | somewhere. 127 | */ 128 | 129 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 130 | unsigned char *input_payload_data, 131 | int num_payload_data_bytes) 132 | { 133 | int num_tx_data_bytes, num_payload_data_bits; 134 | unsigned char *pout = output_tx_data; 135 | int ninbit, ningolay, nparitybits; 136 | int32_t ingolay, paritybyte, inbit, golayparity; 137 | int ninbyte, shift, golayparitybit, i; 138 | 139 | num_tx_data_bytes = horus_l2_get_num_tx_data_bytes(num_payload_data_bytes); 140 | memcpy(pout, uw, sizeof(uw)); pout += sizeof(uw); 141 | memcpy(pout, input_payload_data, num_payload_data_bytes); pout += num_payload_data_bytes; 142 | 143 | /* Read input bits one at a time. Fill input Golay codeword. Find output Golay codeword. 144 | Write this to parity bits. Write parity bytes when we have 8 parity bits. Bits are 145 | written MSB first. */ 146 | 147 | num_payload_data_bits = num_payload_data_bytes*8; 148 | ninbit = 0; 149 | ingolay = 0; 150 | ningolay = 0; 151 | paritybyte = 0; 152 | nparitybits = 0; 153 | 154 | while (ninbit < num_payload_data_bits) { 155 | 156 | /* extract input data bit */ 157 | 158 | ninbyte = ninbit/8; 159 | shift = 7 - (ninbit % 8); 160 | inbit = (input_payload_data[ninbyte] >> shift) & 0x1; 161 | #ifdef DEBUG1 162 | fprintf(stderr, "inbit %d ninbyte: %d inbyte: 0x%02x inbit: %d\n", 163 | ninbit, ninbyte, input_payload_data[ninbyte], inbit); 164 | #endif 165 | ninbit++; 166 | 167 | /* build up input golay codeword */ 168 | 169 | ingolay = ingolay | inbit; 170 | ningolay++; 171 | 172 | /* when we get 12 bits do a Golay encode */ 173 | 174 | if (ningolay % 12) { 175 | ingolay <<= 1; 176 | } 177 | else { 178 | #ifdef DEBUG0 179 | fprintf(stderr, " ningolay: %d ingolay: 0x%04x\n", ningolay, ingolay); 180 | #endif 181 | golayparity = get_syndrome(ingolay<<11); 182 | ingolay = 0; 183 | 184 | #ifdef DEBUG0 185 | fprintf(stderr, " golayparity: 0x%04x\n", golayparity); 186 | #endif 187 | 188 | /* write parity bits to output data */ 189 | 190 | for (i=0; i<11; i++) { 191 | golayparitybit = (golayparity >> (10-i)) & 0x1; 192 | paritybyte = paritybyte | golayparitybit; 193 | #ifdef DEBUG0 194 | fprintf(stderr, " i: %d golayparitybit: %d paritybyte: 0x%02x\n", 195 | i, golayparitybit, paritybyte); 196 | #endif 197 | nparitybits++; 198 | if (nparitybits % 8) { 199 | paritybyte <<= 1; 200 | } 201 | else { 202 | /* OK we have a full byte ready */ 203 | *pout = paritybyte; 204 | #ifdef DEBUG0 205 | fprintf(stderr," Write paritybyte: 0x%02x\n", paritybyte); 206 | #endif 207 | pout++; 208 | paritybyte = 0; 209 | } 210 | } 211 | } 212 | } /* while(.... */ 213 | 214 | 215 | /* Complete final Golay encode, we may have partially finished ingolay, paritybyte */ 216 | 217 | #ifdef DEBUG0 218 | fprintf(stderr, "finishing up .....\n"); 219 | #endif 220 | 221 | if (ningolay % 12) { 222 | ingolay >>= 1; 223 | golayparity = get_syndrome(ingolay<<12); 224 | #ifdef DEBUG0 225 | fprintf(stderr, " ningolay: %d ingolay: 0x%04x\n", ningolay, ingolay); 226 | fprintf(stderr, " golayparity: 0x%04x\n", golayparity); 227 | #endif 228 | 229 | /* write parity bits to output data */ 230 | 231 | for (i=0; i<11; i++) { 232 | golayparitybit = (golayparity >> (10 - i)) & 0x1; 233 | paritybyte = paritybyte | golayparitybit; 234 | #ifdef DEBUG1 235 | fprintf(stderr, " i: %d golayparitybit: %d paritybyte: 0x%02x\n", 236 | i, golayparitybit, paritybyte); 237 | #endif 238 | nparitybits++; 239 | if (nparitybits % 8) { 240 | paritybyte <<= 1; 241 | } 242 | else { 243 | /* OK we have a full byte ready */ 244 | *pout++ = (unsigned char)paritybyte; 245 | #ifdef DEBUG0 246 | fprintf(stderr," Write paritybyte: 0x%02x\n", paritybyte); 247 | #endif 248 | paritybyte = 0; 249 | } 250 | } 251 | } 252 | 253 | /* and final, partially complete, parity byte */ 254 | 255 | if (nparitybits % 8) { 256 | paritybyte <<= 7 - (nparitybits % 8); // use MS bits first 257 | *pout++ = (unsigned char)paritybyte; 258 | #ifdef DEBUG0 259 | fprintf(stderr," Write last paritybyte: 0x%02x nparitybits: %d \n", paritybyte, nparitybits); 260 | #endif 261 | } 262 | 263 | #ifdef DEBUG0 264 | fprintf(stderr, "\npout - output_tx_data: %ld num_tx_data_bytes: %d\n", 265 | pout - output_tx_data, num_tx_data_bytes); 266 | #endif 267 | assert(pout == (output_tx_data + num_tx_data_bytes)); 268 | 269 | /* optional interleaver - we dont interleave UW */ 270 | 271 | #ifdef INTERLEAVER 272 | interleave(&output_tx_data[sizeof(uw)], num_tx_data_bytes-2, 0); 273 | #endif 274 | 275 | /* optional scrambler to prevent long strings of the same symbol 276 | which upsets the modem - we dont scramble UW */ 277 | 278 | #ifdef SCRAMBLER 279 | scramble(&output_tx_data[sizeof(uw)], num_tx_data_bytes-2); 280 | #endif 281 | 282 | return num_tx_data_bytes; 283 | } 284 | 285 | 286 | #ifdef HORUS_L2_RX 287 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 288 | unsigned char *input_rx_data, 289 | int num_payload_data_bytes) 290 | { 291 | int num_payload_data_bits; 292 | unsigned char *pout = output_payload_data; 293 | unsigned char *pin = input_rx_data; 294 | int ninbit, ingolay, ningolay, paritybyte, nparitybits; 295 | int ninbyte, shift, inbit, golayparitybit, i, outbit, outbyte, noutbits, outdata; 296 | int num_tx_data_bytes = horus_l2_get_num_tx_data_bytes(num_payload_data_bytes); 297 | 298 | /* optional scrambler and interleaver - we dont interleave UW */ 299 | 300 | #ifdef SCRAMBLER 301 | scramble(&input_rx_data[sizeof(uw)], num_tx_data_bytes-2); 302 | #endif 303 | 304 | #ifdef INTERLEAVER 305 | interleave(&input_rx_data[sizeof(uw)], num_tx_data_bytes-2, 1); 306 | #endif 307 | 308 | pin = input_rx_data + sizeof(uw) + num_payload_data_bytes; 309 | 310 | /* Read input data bits one at a time. When we have 12 read 11 parity bits. Golay decode. 311 | Write decoded (output data) bits every time we have 8 of them. */ 312 | 313 | num_payload_data_bits = num_payload_data_bytes*8; 314 | ninbit = 0; 315 | ingolay = 0; 316 | ningolay = 0; 317 | nparitybits = 0; 318 | paritybyte = *pin++; 319 | #ifdef DEBUG0 320 | fprintf(stderr," Read paritybyte: 0x%02x\n", paritybyte); 321 | #endif 322 | pout = output_payload_data; 323 | noutbits = 0; 324 | outbyte = 0; 325 | 326 | while (ninbit < num_payload_data_bits) { 327 | 328 | /* extract input data bit */ 329 | 330 | ninbyte = ninbit/8 + sizeof(uw); 331 | shift = 7 - (ninbit % 8); 332 | inbit = (input_rx_data[ninbyte] >> shift) & 0x1; 333 | #ifdef DEBUG1 334 | fprintf(stderr, "inbit %d ninbyte: %d inbyte: 0x%02x inbit: %d\n", 335 | ninbit, ninbyte, input_rx_data[ninbyte], inbit); 336 | #endif 337 | ninbit++; 338 | 339 | /* build up golay codeword */ 340 | 341 | ingolay = ingolay | inbit; 342 | ningolay++; 343 | ingolay <<= 1; 344 | 345 | /* when we get 12 data bits start reading parity bits */ 346 | 347 | if ((ningolay % 12) == 0) { 348 | #ifdef DEBUG0 349 | fprintf(stderr, " ningolay: %d ingolay: 0x%04x\n", ningolay, ingolay>>1); 350 | #endif 351 | for (i=0; i<11; i++) { 352 | shift = 7 - (nparitybits % 8); 353 | golayparitybit = (paritybyte >> shift) & 0x1; 354 | ingolay |= golayparitybit; 355 | if (i != 10) 356 | ingolay <<=1; 357 | nparitybits++; 358 | if ((nparitybits % 8) == 0) { 359 | /* OK grab a new byte */ 360 | paritybyte = *pin++; 361 | #ifdef DEBUG0 362 | fprintf(stderr," Read paritybyte: 0x%02x\n", paritybyte); 363 | #endif 364 | } 365 | } 366 | 367 | #ifdef DEBUG0 368 | fprintf(stderr, " golay code word: 0x%04x\n", ingolay); 369 | fprintf(stderr, " golay decode...: 0x%04x\n", golay23_decode(ingolay)); 370 | #endif 371 | 372 | /* write decoded/error corrected bits to output payload data */ 373 | 374 | outdata = golay23_decode(ingolay) >> 11; 375 | #ifdef DEBUG0 376 | fprintf(stderr, " outdata...: 0x%04x\n", outdata); 377 | #endif 378 | 379 | for(i=0; i<12; i++) { 380 | shift = 11 - i; 381 | outbit = (outdata >> shift) & 0x1; 382 | outbyte |= outbit; 383 | noutbits++; 384 | if (noutbits % 8) { 385 | outbyte <<= 1; 386 | } 387 | else { 388 | #ifdef DEBUG0 389 | fprintf(stderr, " output payload byte: 0x%02x\n", outbyte); 390 | #endif 391 | *pout++ = outbyte; 392 | outbyte = 0; 393 | } 394 | } 395 | 396 | ingolay = 0; 397 | } 398 | } /* while(.... */ 399 | 400 | 401 | #ifdef DEBUG0 402 | fprintf(stderr, "finishing up .....\n"); 403 | #endif 404 | 405 | /* Complete final Golay decode */ 406 | 407 | int golayparity = 0; 408 | if (ningolay % 12) { 409 | for (i=0; i<11; i++) { 410 | shift = 7 - (nparitybits % 8); 411 | golayparitybit = (paritybyte >> shift) & 0x1; 412 | golayparity |= golayparitybit; 413 | if (i != 10) 414 | golayparity <<=1; 415 | nparitybits++; 416 | if ((nparitybits % 8) == 0) { 417 | /* OK grab a new byte */ 418 | paritybyte = *pin++; 419 | #ifdef DEBUG0 420 | fprintf(stderr," Read paritybyte: 0x%02x\n", paritybyte); 421 | #endif 422 | } 423 | } 424 | 425 | ingolay >>= 1; 426 | int codeword = (ingolay<<12) + golayparity; 427 | #ifdef DEBUG0 428 | fprintf(stderr, " ningolay: %d ingolay: 0x%04x\n", ningolay, ingolay); 429 | fprintf(stderr, " golay code word: 0x%04x\n", codeword); 430 | fprintf(stderr, " golay decode...: 0x%04x\n", golay23_decode(codeword)); 431 | #endif 432 | 433 | outdata = golay23_decode(codeword) >> 11; 434 | #ifdef DEBUG0 435 | fprintf(stderr, " outdata...: 0x%04x\n", outdata); 436 | fprintf(stderr, " num_payload_data_bits: %d noutbits: %d\n", num_payload_data_bits, noutbits); 437 | #endif 438 | 439 | /* write final byte */ 440 | 441 | int ntogo = num_payload_data_bits - noutbits; 442 | for(i=0; i> shift) & 0x1; 445 | outbyte |= outbit; 446 | noutbits++; 447 | if (noutbits % 8) { 448 | outbyte <<= 1; 449 | } 450 | else { 451 | #ifdef DEBUG0 452 | fprintf(stderr, " output payload byte: 0x%02x\n", outbyte); 453 | #endif 454 | *pout++ = outbyte; 455 | outbyte = 0; 456 | } 457 | } 458 | } 459 | 460 | #ifdef DEBUG0 461 | fprintf(stderr, "\npin - output_payload_data: %ld num_payload_data_bytes: %d\n", 462 | pout - output_payload_data, num_payload_data_bytes); 463 | #endif 464 | 465 | assert(pout == (output_payload_data + num_payload_data_bytes)); 466 | 467 | } 468 | #endif 469 | 470 | #ifdef INTERLEAVER 471 | 472 | uint16_t primes[] = { 473 | 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 474 | 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 475 | 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 476 | 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 477 | 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 478 | 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 479 | 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 480 | 379, 383, 389, 757, 761, 769, 773 481 | }; 482 | 483 | void interleave(unsigned char *inout, int nbytes, int dir) 484 | { 485 | uint16_t nbits = (uint16_t)nbytes*8; 486 | uint32_t i, j, n, ibit, ibyte, ishift, jbyte, jshift; 487 | uint32_t b; 488 | unsigned char out[nbytes]; 489 | 490 | 491 | memset(out, 0, nbytes); 492 | 493 | /* b chosen to be co-prime with nbits, I'm cheating by just finding the 494 | nearest prime to nbits. It also uses storage, is run on every call, 495 | and has an upper limit. Oh Well, still seems to interleave OK. */ 496 | i = 1; 497 | uint16_t imax = sizeof(primes)/sizeof(uint16_t); 498 | while ((primes[i] < nbits) && (i < imax)) 499 | i++; 500 | b = primes[i-1]; 501 | 502 | for(n=0; n> ishift) & 0x1; 526 | 527 | jbyte = j/8; 528 | jshift = j%8; 529 | 530 | /* write jbit to ibit position */ 531 | 532 | out[jbyte] |= ibit << jshift; // replace with i-th bit 533 | //out[ibyte] |= ibit << ishift; // replace with i-th bit 534 | } 535 | 536 | memcpy(inout, out, nbytes); 537 | 538 | #ifdef DEBUG0 539 | printf("\nInterleaver Out:\n"); 540 | for (i=0; i> 1) ^ (scrambler & 0x1); 594 | 595 | /* modify i-th bit by xor-ing with scrambler output sequence */ 596 | 597 | ibyte = i/8; 598 | ishift = i%8; 599 | ibit = (inout[ibyte] >> ishift) & 0x1; 600 | ibits = ibit ^ scrambler_out; // xor ibit with scrambler output 601 | 602 | mask = 1 << ishift; 603 | inout[ibyte] &= ~mask; // clear i-th bit 604 | inout[ibyte] |= ibits << ishift; // set to scrambled value 605 | 606 | /* update scrambler */ 607 | 608 | scrambler >>= 1; 609 | scrambler |= scrambler_out << 14; 610 | 611 | #ifdef DEBUG0 612 | printf("i: %02d ibyte: %d ishift: %d ibit: %d ibits: %d scrambler_out: %d\n", 613 | i, ibyte, ishift, ibit, ibits, scrambler_out); 614 | #endif 615 | 616 | } 617 | 618 | #ifdef DEBUG0 619 | printf("\nScrambler Out:\n"); 620 | for (i=0; i>b) & 0x1; 730 | } 731 | 732 | return nerr; 733 | } 734 | 735 | /* unit test designed to run on a PC */ 736 | 737 | /* Horus binary packet */ 738 | 739 | struct TBinaryPacket 740 | { 741 | uint8_t PayloadID; 742 | uint16_t Counter; 743 | uint8_t Hours; 744 | uint8_t Minutes; 745 | uint8_t Seconds; 746 | float Latitude; 747 | float Longitude; 748 | uint16_t Altitude; 749 | uint8_t Speed; // Speed in Knots (1-255 knots) 750 | uint8_t Sats; 751 | int8_t Temp; // Twos Complement Temp value. 752 | uint8_t BattVoltage; // 0 = 0.5v, 255 = 2.0V, linear steps in-between. 753 | uint16_t Checksum; // CRC16-CCITT Checksum. 754 | } __attribute__ ((packed)); 755 | 756 | int main(void) { 757 | int nbytes = sizeof(struct TBinaryPacket); 758 | printf("test 0: BER: 0.00 ...........: %d\n", test_sending_bytes(nbytes, 0.00, 0)); 759 | printf("test 1: BER: 0.01 ...........: %d\n", test_sending_bytes(nbytes, 0.01, 0)); 760 | printf("test 2: BER: 0.05 ...........: %d\n", test_sending_bytes(nbytes, 0.05, 0)); 761 | 762 | /* we expect this always to fail, as chance of > 3 errors/codeword is high */ 763 | 764 | printf("test 3: BER: 0.10 ...........: %d\n", test_sending_bytes(nbytes, 0.10, 0)); 765 | 766 | /* -DINTERLEAVER will make this puppy pass */ 767 | 768 | printf("test 4: 8 bit burst error....: %d\n", test_sending_bytes(nbytes, 0.00, 1)); 769 | 770 | /* Insert 2 errors in every codeword, the maximum correction 771 | capability of a Golay (23,12) code. note this one will fail 772 | with -DINTERLEAVER, as we can't guarantee <= 3 errors per 773 | codeword after interleaving */ 774 | 775 | printf("test 5: 1 error every 12 bits: %d\n", test_sending_bytes(nbytes, 0.00, 2)); 776 | return 0; 777 | } 778 | #endif 779 | 780 | 781 | 782 | #ifdef GEN_TX_BITS 783 | /* generate a file of tx_bits to modulate using fsk_horus.m for modem simulations */ 784 | 785 | int main(void) { 786 | int nbytes = sizeof(struct TBinaryPacket); 787 | struct TBinaryPacket input_payload; 788 | int num_tx_data_bytes = horus_l2_get_num_tx_data_bytes(nbytes); 789 | unsigned char tx[num_tx_data_bytes]; 790 | int i; 791 | 792 | /* all zeros is nastiest sequence for demod before scrambling */ 793 | 794 | memset(&input_payload, 0, nbytes); 795 | input_payload.Checksum = gen_crc16((unsigned char*)&input_payload, nbytes-2); 796 | 797 | horus_l2_encode_tx_packet(tx, (unsigned char*)&input_payload, nbytes); 798 | 799 | FILE *f = fopen("../octave/horus_tx_bits_binary.txt","wt"); 800 | assert(f != NULL); 801 | int b, tx_bit; 802 | for(i=0; i> (7-b)) & 0x1; /* msb first */ 805 | fprintf(f,"%d ", tx_bit); 806 | } 807 | } 808 | fclose(f); 809 | 810 | return 0; 811 | } 812 | #endif 813 | 814 | 815 | #ifdef DEC_RX_BITS 816 | 817 | /* Decode a binary file rx_bytes, e.g. from fsk_horus.m */ 818 | 819 | int main(void) { 820 | int nbytes = 22; 821 | unsigned char output_payload[nbytes]; 822 | int num_tx_data_bytes = horus_l2_get_num_tx_data_bytes(nbytes); 823 | 824 | /* real world data horus payload generated when running tx above */ 825 | unsigned char rx[45] = { 826 | 0x24,0x24,0x01,0x0b,0x00,0x00,0x05,0x3b,0xf2,0xa7,0x0b,0xc2,0x1b, 827 | 0xaa,0x0a,0x43,0x7e,0x00,0x05,0x00,0x25,0xc0,0xce,0xbb,0x36,0x69, 828 | 0x50,0x00,0x41,0xb0,0xa6,0x5e,0x91,0xa2,0xa3,0xf8,0x1d,0x00,0x00, 829 | 0x0c,0x76,0xc6,0x05,0xb0,0xb8}; 830 | int i, ret; 831 | 832 | assert(num_tx_data_bytes == 45); 833 | 834 | #define READ_FILE /* overwrite tx[] above, that's OK */ 835 | #ifdef READ_FILE 836 | FILE *f = fopen("../octave/horus_rx_bits_binary.bin","rb"); 837 | assert(f != NULL); 838 | ret = fread(rx, sizeof(char), num_tx_data_bytes, f); 839 | assert(ret == num_tx_data_bytes); 840 | fclose(f); 841 | #endif 842 | 843 | golay23_init(); 844 | horus_l2_decode_rx_packet(output_payload, rx, nbytes); 845 | 846 | #ifdef HEX_DUMP 847 | fprintf(stderr, "\nOutput Payload:\n"); 848 | for(i=0; i 941 | #include 942 | #include 943 | #define X22 0x00400000 /* vector representation of X^{22} */ 944 | #define X11 0x00000800 /* vector representation of X^{11} */ 945 | #define MASK12 0xfffff800 /* auxiliary vector for testing */ 946 | #define GENPOL 0x00000c75 /* generator polinomial, g(x) */ 947 | 948 | /* Global variables: 949 | * 950 | * pattern = error pattern, or information, or received vector 951 | * encoding_table[] = encoding table 952 | * decoding_table[] = decoding table 953 | * data = information bits, i(x) 954 | * codeword = code bits = x^{11}i(x) + (x^{11}i(x) mod g(x)) 955 | * numerr = number of errors = Hamming weight of error polynomial e(x) 956 | * position[] = error positions in the vector representation of e(x) 957 | * recd = representation of corrupted received polynomial r(x) = c(x) + e(x) 958 | * decerror = number of decoding errors 959 | * a[] = auxiliary array to generate correctable error patterns 960 | */ 961 | 962 | #ifdef HORUS_L2_RX 963 | static int inited = 0; 964 | 965 | #ifdef RUN_TIME_TABLES 966 | static int encoding_table[4096], decoding_table[2048]; 967 | #else 968 | #include "golayenctable.h" 969 | #include "golaydectable.h" 970 | #endif 971 | 972 | #ifdef RUN_TIME_TABLES 973 | static int arr2int(int a[], int r) 974 | /* 975 | * Convert a binary vector of Hamming weight r, and nonzero positions in 976 | * array a[1]...a[r], to a long integer \sum_{i=1}^r 2^{a[i]-1}. 977 | */ 978 | { 979 | int i; 980 | long mul, result = 0, temp; 981 | 982 | for (i=1; i<=r; i++) { 983 | mul = 1; 984 | temp = a[i]-1; 985 | while (temp--) 986 | mul = mul << 1; 987 | result += mul; 988 | } 989 | return(result); 990 | } 991 | #endif 992 | #endif 993 | 994 | #ifdef HORUS_L2_RX 995 | void nextcomb(int n, int r, int a[]) 996 | /* 997 | * Calculate next r-combination of an n-set. 998 | */ 999 | { 1000 | int i, j; 1001 | 1002 | a[r]++; 1003 | if (a[r] <= n) 1004 | return; 1005 | j = r - 1; 1006 | while (a[j] == n - r + j) 1007 | j--; 1008 | for (i = r; i >= j; i--) 1009 | a[i] = a[j] + i - j + 1; 1010 | return; 1011 | } 1012 | #endif 1013 | 1014 | int32_t get_syndrome(int32_t pattern) 1015 | /* 1016 | * Compute the syndrome corresponding to the given pattern, i.e., the 1017 | * remainder after dividing the pattern (when considering it as the vector 1018 | * representation of a polynomial) by the generator polynomial, GENPOL. 1019 | * In the program this pattern has several meanings: (1) pattern = infomation 1020 | * bits, when constructing the encoding table; (2) pattern = error pattern, 1021 | * when constructing the decoding table; and (3) pattern = received vector, to 1022 | * obtain its syndrome in decoding. 1023 | */ 1024 | { 1025 | int32_t aux = X22; 1026 | 1027 | if (pattern >= X11) 1028 | while (pattern & MASK12) { 1029 | while (!(aux & pattern)) 1030 | aux = aux >> 1; 1031 | pattern ^= (aux/X11) * GENPOL; 1032 | } 1033 | return(pattern); 1034 | } 1035 | 1036 | #ifdef HORUS_L2_RX 1037 | 1038 | /*---------------------------------------------------------------------------*\ 1039 | 1040 | FUNCTION....: golay23_init() 1041 | AUTHOR......: David Rowe 1042 | DATE CREATED: 3 March 2013 1043 | 1044 | Call this once when you start your program to init the Golay tables. 1045 | 1046 | \*---------------------------------------------------------------------------*/ 1047 | 1048 | void golay23_init(void) { 1049 | #ifdef RUN_TIME_TABLES 1050 | int i; 1051 | long temp; 1052 | int a[4]; 1053 | int pattern; 1054 | 1055 | /* 1056 | * --------------------------------------------------------------------- 1057 | * Generate ENCODING TABLE 1058 | * 1059 | * An entry to the table is an information vector, a 32-bit integer, 1060 | * whose 12 least significant positions are the information bits. The 1061 | * resulting value is a codeword in the (23,12,7) Golay code: A 32-bit 1062 | * integer whose 23 least significant bits are coded bits: Of these, the 1063 | * 12 most significant bits are information bits and the 11 least 1064 | * significant bits are redundant bits (systematic encoding). 1065 | * --------------------------------------------------------------------- 1066 | */ 1067 | for (pattern = 0; pattern < 4096; pattern++) { 1068 | temp = pattern << 11; /* multiply information by X^{11} */ 1069 | encoding_table[pattern] = temp + get_syndrome(temp);/* add redundancy */ 1070 | } 1071 | 1072 | /* 1073 | * --------------------------------------------------------------------- 1074 | * Generate DECODING TABLE 1075 | * 1076 | * An entry to the decoding table is a syndrome and the resulting value 1077 | * is the most likely error pattern. First an error pattern is generated. 1078 | * Then its syndrome is calculated and used as a pointer to the table 1079 | * where the error pattern value is stored. 1080 | * --------------------------------------------------------------------- 1081 | * 1082 | * (1) Error patterns of WEIGHT 1 (SINGLE ERRORS) 1083 | */ 1084 | decoding_table[0] = 0; 1085 | decoding_table[1] = 1; 1086 | temp = 1; 1087 | for (i=2; i<= 23; i++) { 1088 | temp *= 2; 1089 | decoding_table[get_syndrome(temp)] = temp; 1090 | } 1091 | /* 1092 | * (2) Error patterns of WEIGHT 2 (DOUBLE ERRORS) 1093 | */ 1094 | a[1] = 1; a[2] = 2; 1095 | temp = arr2int(a,2); 1096 | decoding_table[get_syndrome(temp)] = temp; 1097 | for (i=1; i<253; i++) { 1098 | nextcomb(23,2,a); 1099 | temp = arr2int(a,2); 1100 | decoding_table[get_syndrome(temp)] = temp; 1101 | } 1102 | /* 1103 | * (3) Error patterns of WEIGHT 3 (TRIPLE ERRORS) 1104 | */ 1105 | a[1] = 1; a[2] = 2; a[3] = 3; 1106 | temp = arr2int(a,3); 1107 | decoding_table[get_syndrome(temp)] = temp; 1108 | for (i=1; i<1771; i++) { 1109 | nextcomb(23,3,a); 1110 | temp = arr2int(a,3); 1111 | decoding_table[get_syndrome(temp)] = temp; 1112 | } 1113 | #endif 1114 | inited = 1; 1115 | } 1116 | 1117 | /*---------------------------------------------------------------------------*\ 1118 | 1119 | FUNCTION....: golay23_encode() 1120 | AUTHOR......: David Rowe 1121 | DATE CREATED: 3 March 2013 1122 | 1123 | Given 12 bits of data retiurns a 23 bit codeword for transmission 1124 | over the channel. 1125 | 1126 | \*---------------------------------------------------------------------------*/ 1127 | 1128 | int golay23_encode(int data) { 1129 | assert(inited); 1130 | assert(data <= 0xfff); 1131 | 1132 | //printf("data: 0x%x\n", data); 1133 | return encoding_table[data]; 1134 | } 1135 | 1136 | /*---------------------------------------------------------------------------*\ 1137 | 1138 | FUNCTION....: golay23_decode() 1139 | AUTHOR......: David Rowe 1140 | DATE CREATED: 3 March 2013 1141 | 1142 | Given a 23 bit received codeword, returns the 12 bit corrected data. 1143 | 1144 | \*---------------------------------------------------------------------------*/ 1145 | 1146 | int golay23_decode(int received_codeword) { 1147 | assert(inited); 1148 | assert((received_codeword < (1<<23)) && (received_codeword >= 0)); 1149 | 1150 | //printf("syndrome: 0x%x\n", get_syndrome(received_codeword)); 1151 | return received_codeword ^= decoding_table[get_syndrome(received_codeword)]; 1152 | } 1153 | 1154 | int golay23_count_errors(int recd_codeword, int corrected_codeword) 1155 | { 1156 | int errors = 0; 1157 | int diff, i; 1158 | 1159 | diff = recd_codeword ^ corrected_codeword; 1160 | for(i=0; i<23; i++) { 1161 | if (diff & 0x1) 1162 | errors++; 1163 | diff >>= 1; 1164 | } 1165 | 1166 | return errors; 1167 | } 1168 | 1169 | #endif 1170 | 1171 | // from http://stackoverflow.com/questions/10564491/function-to-calculate-a-crc16-checksum 1172 | 1173 | unsigned short gen_crc16(unsigned char* data_p, unsigned char length){ 1174 | unsigned char x; 1175 | unsigned short crc = 0xFFFF; 1176 | 1177 | while (length--){ 1178 | x = crc >> 8 ^ *data_p++; 1179 | x ^= x>>4; 1180 | crc = (crc << 8) ^ ((unsigned short)(x << 12)) ^ ((unsigned short)(x <<5)) ^ ((unsigned short)x); 1181 | } 1182 | return crc; 1183 | } 1184 | 1185 | -------------------------------------------------------------------------------- /fw/fw-files/rs41-nfw/horus_l2.h: -------------------------------------------------------------------------------- 1 | /*---------------------------------------------------------------------------*\ 2 | 3 | FILE........: horus_l2.h 4 | AUTHOR......: David Rowe 5 | DATE CREATED: Dec 2015 6 | 7 | \*---------------------------------------------------------------------------*/ 8 | 9 | #ifndef __HORUS_L2__ 10 | #define __HORUS_L2__ 11 | 12 | int horus_l2_get_num_tx_data_bytes(int num_payload_data_bytes); 13 | 14 | /* returns number of output bytes in output_tx_data */ 15 | int horus_l2_encode_tx_packet(unsigned char *output_tx_data, 16 | unsigned char *input_payload_data, 17 | int num_payload_data_bytes); 18 | 19 | void horus_l2_decode_rx_packet(unsigned char *output_payload_data, 20 | unsigned char *input_rx_data, 21 | int num_payload_data_bytes); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /fw/nfw-dataRecorder-decoder/decoder.py: -------------------------------------------------------------------------------- 1 | import sys 2 | 3 | # ANSI escape codes for coloring text 4 | GREEN = '\033[32m' 5 | RED = '\033[31m' 6 | YELLOW = '\033[33m' 7 | ORANGE = '\033[38;5;214m' # ANSI escape code for orange 8 | RESET = '\033[0m' 9 | 10 | def decode_nfw_packet(packet): 11 | # Define the expected structure and number of fields, adding GPS signal anomalies and GPS HDOP 12 | expected_fields = [ 13 | "maxAlt (m)", 14 | "maxSpeed (km/h)", 15 | "maxAscentRate (m/s)", 16 | "maxDescentRate (m/s)", 17 | "maxMainTemperature (\u00b0C)", 18 | "minMainTemperature (\u00b0C)", 19 | "maxInternalTemperature (\u00b0C)", 20 | "minInternalTemperature (\u00b0C)", 21 | "ledsEnable (1 - yes, 0 - no)", 22 | "status (0 - ok, 1 - warn, 2 - err)", 23 | "gpsResetCounter", 24 | "beganFlying (1 - yes, 0 - no)", 25 | "burstDetected (1 - yes, 0 - no)", 26 | "radioPwrSetting (0 to 7, power levels of SI4032 in dBm and mW)", 27 | "currentGPSPowerMode (0 - disabled, 1 - max performance, 2 - powersaving)", 28 | "radioTemp (\u00b0C)", 29 | "sensorBoomErr (0 - Clear, 1 - ERR)", 30 | "zeroHumidityFrequency (Hz)", # New field 31 | "humidityRangeDelta (Hz)", # New field 32 | "heatingPwmStatus", # New field 33 | "referenceHeaterStatus", # New field 34 | "mvBatU (mV)", # New field 35 | "referenceAreaTemperature (\u00b0C)", # New field 36 | "gpsSignalAnomalies (1 - true, 0 - false)", # New field for GPS signal anomalies 37 | "gpsHDOP" # New field for GPS HDOP 38 | ] 39 | 40 | # Remove the last semicolon if present 41 | if packet.endswith(';'): 42 | packet = packet[:-1] 43 | 44 | # Split the packet into parts 45 | parts = packet.split("NFW;") 46 | if len(parts) < 2: 47 | print("Error: No NFW structure detected.") 48 | return 49 | 50 | # Extract the NFW part and split it by semicolons 51 | nfw_part = parts[1].strip() 52 | fields = nfw_part.split(";") 53 | 54 | # Check for the exact number of fields 55 | if len(fields) != len(expected_fields): 56 | print(f"Error: Expected {len(expected_fields)} values in NFW packet but got {len(fields)}.") 57 | return 58 | 59 | # Decode the fields into a dictionary 60 | decoded = {expected_fields[i]: fields[i] for i in range(len(expected_fields))} 61 | 62 | # Print the decoded meaning with color formatting 63 | print("Decoded NFW Packet:") 64 | for field, value in decoded.items(): 65 | if "ledsEnable" in field: 66 | value_color = GREEN if value == "1" else RED 67 | value_text = "YES" if value == "1" else "NO" 68 | print(f" {field.split(' ')[0]}: {value_color}{value_text} ({value}){RESET}") 69 | elif "status" in field: 70 | if value == "0": 71 | value_text = "OK" 72 | value_color = GREEN 73 | elif value == "1": 74 | value_text = "Warning" 75 | value_color = YELLOW 76 | else: 77 | value_text = "Error" 78 | value_color = RED 79 | print(f" {field.split(' ')[0]}: {value_color}{value_text} ({value}){RESET}") 80 | elif "beganFlying" in field: 81 | value_color = GREEN if value == "1" else RED 82 | value_text = "YES" if value == "1" else "NO" 83 | print(f" {field.split(' ')[0]}: {value_color}{value_text} ({value}){RESET}") 84 | elif "burstDetected" in field: 85 | value_color = GREEN if value == "1" else RED 86 | value_text = "YES" if value == "1" else "NO" 87 | print(f" {field.split(' ')[0]}: {value_color}{value_text} ({value}){RESET}") 88 | elif "currentGPSPowerMode" in field: 89 | if value == "0": 90 | value_text = "Disabled" 91 | value_color = RED 92 | elif value == "1": 93 | value_text = "Max Performance" 94 | value_color = GREEN 95 | else: 96 | value_text = "Power Saving" 97 | value_color = YELLOW 98 | print(f" {field.split(' ')[0]}: {value_color}{value_text} ({value}){RESET}") 99 | elif "radioPwrSetting" in field: 100 | # Power levels for SI4032 chip in dBm and mW 101 | power_levels_dBm_mW = { 102 | "0": "-1 dBm (~0.8 mW)", 103 | "1": "2 dBm (~1.6 mW)", 104 | "2": "5 dBm (~3 mW)", 105 | "3": "8 dBm (~6 mW)", 106 | "4": "11 dBm (~12 mW)", 107 | "5": "14 dBm (~25 mW)", 108 | "6": "17 dBm (~50 mW)", 109 | "7": "20 dBm (~100 mW)" 110 | } 111 | value_color = GREEN # Here we just use yellow for power levels 112 | value_text = power_levels_dBm_mW.get(value, "Unknown Power Level") 113 | print(f" {field.split(' ')[0]}: {value_color}{value_text} ({value}){RESET}") 114 | elif "Temperature" in field or "radioTemp" in field: 115 | # For temperature fields, append °C 116 | print(f" {field.split(' ')[0]}: {value}°C") 117 | elif "maxSpeed" in field: 118 | # For speed append kph 119 | print(f" {field.split(' ')[0]}: {value} km/h") 120 | elif "maxAscentRate" in field or "maxDescentRate" in field: 121 | # For speed and rates, append m/s 122 | print(f" {field.split(' ')[0]}: {value} m/s") 123 | elif "maxAlt" in field: 124 | # For maxAlt, append m (meters) 125 | print(f" {field.split(' ')[0]}: {value} m") 126 | elif "sensorBoomErr" in field: 127 | # Handle the sensorBoomErr field 128 | if value == "1": 129 | value_color = RED 130 | value_text = "ERR" 131 | else: 132 | value_color = GREEN 133 | value_text = "Clear" 134 | print(f" {field.split(' ')[0]}: {value_color}{value_text} ({value}){RESET}") 135 | elif "zeroHumidityFrequency" in field: 136 | # Handle the zeroHumidityFrequency field (red if 0) 137 | value_color = RED if value == "0" else RESET 138 | print(f" {field.split(' ')[0]}: {value_color}{value} Hz{RESET}") 139 | elif "humidityRangeDelta" in field: 140 | # Handle the humidityRangeDelta field (in Hz) 141 | print(f" {field.split(' ')[0]}: {value} Hz") 142 | elif "heatingPwmStatus" in field: 143 | # Decode heating PWM status with color 144 | pwm_value = int(value) 145 | if 0 < pwm_value <= 255: 146 | print(f" Humidity heating power: {ORANGE}L: ON {pwm_value}/255{RESET} | {GREEN}H: OFF{RESET}") 147 | elif 256 <= pwm_value <= 500: 148 | high_power = pwm_value - 255 149 | print(f" Humidity heating power: {ORANGE}L: ON 255/255{RESET} | {RED}H: ON {high_power}/245{RESET}") 150 | else: 151 | print(f" Humidity heating power: {GREEN}L: OFF | H: OFF{RESET}") 152 | elif "referenceHeaterStatus" in field: 153 | # Decode reference heater status with color 154 | heater_status_map = { 155 | "0": (GREEN, "OFF"), 156 | "1": (YELLOW, "Low Power"), 157 | "2": (ORANGE, "Medium Power"), 158 | "3": (RED, "High Power") 159 | } 160 | color, status = heater_status_map.get(value, (RESET, "Unknown")) 161 | print(f" {field.split(' ')[0]}: {color}{status} ({value}){RESET}") 162 | elif "mvBatU" in field: 163 | # Display battery voltage in mV 164 | print(f" {field.split(' ')[0]}: {value} mV") 165 | elif "referenceAreaTemperature" in field: 166 | # Handle the reference area temperature 167 | print(f" {field.split(' ')[0]}: {value}°C") 168 | elif "gpsSignalAnomalies" in field: 169 | # Handle GPS signal anomalies 170 | value_color = RED if value == "1" else GREEN 171 | value_text = "Anomalies Detected" if value == "1" else "No Anomalies" 172 | print(f" {field.split(' ')[0]}: {value_color}{value_text} ({value}){RESET}") 173 | elif "gpsHDOP" in field: 174 | # Handle GPS HDOP 175 | print(f" {field.split(' ')[0]}: {value}") 176 | else: 177 | print(f" {field.split(' ')[0]}: {value}") 178 | 179 | if __name__ == "__main__": 180 | # Read input from the terminal 181 | print("Enter the dataRecorder packet (example: 'NFW;28651;20;-2;0;18;0;28;23;1;0;0;0;0;0;1;24;0;39631;950;16;0;2524;21;0;4'): ") 182 | packet = input().strip() 183 | 184 | # Call the decoder 185 | decode_nfw_packet(packet) 186 | 187 | -------------------------------------------------------------------------------- /fw/photos/aprs-waterfall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/photos/aprs-waterfall.png -------------------------------------------------------------------------------- /fw/photos/erase_and_upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/photos/erase_and_upload.png -------------------------------------------------------------------------------- /fw/photos/horus-waterfall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/photos/horus-waterfall.png -------------------------------------------------------------------------------- /fw/photos/main_window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/photos/main_window.png -------------------------------------------------------------------------------- /fw/photos/mcu-unlock-rsm412.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/photos/mcu-unlock-rsm412.png -------------------------------------------------------------------------------- /fw/photos/mcu-unlock-rsm414.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/photos/mcu-unlock-rsm414.png -------------------------------------------------------------------------------- /fw/photos/morse-waterfall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/photos/morse-waterfall.png -------------------------------------------------------------------------------- /fw/photos/pip-waterfall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/photos/pip-waterfall.png -------------------------------------------------------------------------------- /fw/photos/rtty-waterfall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/photos/rtty-waterfall.png -------------------------------------------------------------------------------- /fw/photos/stlink-connection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/fw/photos/stlink-connection.png -------------------------------------------------------------------------------- /hw/README.md: -------------------------------------------------------------------------------- 1 | # RSM414 hardware 2 | * [References](#references) 3 | * [Older vs newer](#older-vs-newer---how-do-i-know-which-one-im-holding-now) 4 | * [Key components](#key-components) 5 | * [Power supply](#power-supply) 6 | * [Boost converter](#boost-converter) 7 | * [LDOs](#ldos) 8 | * [Hard wired logic](#hard-wired-logic) 9 | * [Microcontroller](#microcontroller) 10 | * [Frontend](#frontend) 11 | * [GPS](#gps) 12 | * [Radio](#radio) 13 | * [Interfaces](#interfaces) 14 | * [SPI Flash](#spi-flash) 15 | * [XDATA Port](#xdata-port) 16 | * [Internal expansion connector](#internal-expansion-connector) 17 | * [NFC interface](#nfc-interface) 18 | * [Final hardware words](#final-hardware-words) 19 | 20 | ## References! 21 | This guide has references to the [radiosonde_hardware repo](https://github.com/bazjo/radiosonde_hardware/tree/master/Vaisala_RS41), and is partially based on it. **Huge thanks** to the author for providing the description.
22 | This page mainly mentions **differences** between old and new revisions, details can be found on the page above.
23 | The component naming also refers to this document, as well as some pin definitions. 24 | 25 | ## Older vs newer - how do I know which one I'm holding now? 26 | Open the enclosure and take out the PCB. On the back side of it (the one without battery holder), in the middle of the coil on the bottom, there should be a PCB model, that starts with `RSM...`
27 | * PCB model with a **last digit of '4'** - newer **~2023** version (for example `RSM414`, `RSM424`) 28 | * PCB model with a **last digit other than '4'**, for example '1' or '2' - *older* version (for example `RSM412`, `RSM421` etc.) 29 | 30 |
31 | 32 | This guide describes hardware used in the `RSM414` newer version of the sonde. 33 | 34 | 35 | # Key components 36 | **PCB - Front photo** 37 |

38 | pcb - front photo
39 |


40 | 41 | **PCB - Rear photo** 42 |

43 | pcb - rear photo
44 |

45 | 46 | 47 | ## Power Supply 48 | ### Boost converter 49 | The boost converter - probably `TPS61200` from Texas Instruments, is used in a standard circuit. It gets enabled via `Q501` P-MOSFET. `Q501` state can be changed via hardwired logic to switch the sonde power. 50 | 51 | ### LDOs 52 | The same as previous revision. 53 | 54 | ### Hard wired logic 55 | It is exactly the same, though an accurate description maybe useful for somebody.
56 | Previously mentioned `Q501` P-MOSFET is controlled via a smaller N-MOSFET `Q502`. The sonde is ON if the `Q502` has a HIGH state on the gate, and it powers off when the gate closes.
57 | 58 | The sonde can be switched on via NFC 13.56MHz carrier signal on it's coil, which sends a rectified signal to the `Q502` gate.
59 | 60 | The button `S501` on the bottom of the sonde can turn on the sonde via `R507` to bring the `Q502` gate to logic HIGH signal. The button status can also be checked with uC via `R509`/`R513`_`C524` voltage divider. The middle leg of the button voltage divider is connected to the uC IO `PA6`. The button voltage gets slightly higher when it's pressed.
61 | 62 | The battery voltage can be measured by the MCU via `R508`/`R512`_`C523` voltage divider. The middle leg of this divider is connected to the `PA5` pin of the MCU.
63 | 64 | Once the `Q502` gets a HIGH signal, it stays open via `R505`, which sends voltage from the battery to the MOSFET gate.
65 | 66 | The sonde can be turned OFF by setting `PA9` MCU pin HIGH, which opens `Q503` N-MOSFET, that shorts the `Q502` gate directly to the ground. This closes the `Q501` and with that the boost converter EN and VIN pins don't receive power anymore. 67 | 68 | 69 | ## Microcontroller 70 |

71 | pcb - front photo
72 |


73 | 74 | As you can already know, it is a new STMicroelectronics [**STM32L412RBT6**](https://eu.mouser.com/datasheet/2/389/stm32l412c8-1851177.pdf) in a LQFP64 package.
75 | Like the previous revision, many of the IOs have RC (resistor-capacitor) low pass filters.
76 | **NOTE:** This description is a little bit outdated, all pin definitions of both revisions are available in the firmware file. 77 | 78 | ## Frontend 79 | It is very similar to the previous version, please refer to the *radiosonde_hardware* repo.
80 | 81 | ## GPS 82 | The GPS module in the new revision is the component that differs the most - this time it is a **uBlox M10050-KB** in a QFN28 package. The circuit around it seems like a standard implementation, with RF filters and probably an LNA chip, and standard coupling capacitors and RC low pass.
83 | The bad thing is that the only official document I could find about it was [this leaflet](https://content.u-blox.com/sites/default/files/UBX-M10050-KB_ProductSummary_UBX-20017986.pdf) which doesn't seem to be a complete datasheet.
84 | Luckily, the circuit implementation isn't hard to understand, so the UART pins were obvious to find. They are located on the right side of the chip, with RC filters before plated holes to the other side of the PCB, connected to pin 16 of the GPS as RX and 17 as a GPX TX. This GPS UART interface is then connected to the `PB6` and `PB7` pins of the uC. 85 | 86 | ## Radio 87 | Nearly the same as in the previous rev.
88 | 89 | It is a Silicon Labs **Si4032**. It uses the same 26MHz clock as the GPS module, so the RF frequency on the output is different then the one set in the registers.
90 | `desired_freq * 26/30 = output_freq`
91 | The register values can be calculated on [this site](https://www.makemehack.com/2020/12/how-to-change-the-tx-frequency-of-the-vaisala-rs41-radiosonde.html), altough the frequency calulation algorithm is already implemented in the firmware. 92 | 93 | ## Interfaces 94 | ### SPI Flash 95 | The SOIC8 SPI flash memory footprint is also available here like in the previous version, probably to be used with a military RS41-SGM edition, that features a Radio Silence Mode. More about it in the *radiosonde_hardware* document. 96 | 97 | ### XDATA Port 98 | The XDATA port is the same on all models, with the following pinout (schematic is a copy from the mentioned repo): 99 | ``` 100 | Pinout of XDATA connector Pinout of connected ribbon cable 101 | ------- 102 | GND | o o | XDATA_RX(PB11) > 1 GND 103 | | | 2 XDATA_RX(PB11) 104 | XDATA_TX(PB10) | o o | +3V_MCU 3 XDATA_TX(PB10) 105 | - | 4 +3V_MCU 106 | V_Boost| o o | VBAT 5 V_Boost 107 | - | 6 VBAT 108 | MCU_RST | o o | SWCLK(PA14) 7 MCU_RST 109 | | | 8 SWCLK(PA14) 110 | SWDIO(PA13) | o o | GND 9 SWDIO(PA13) 111 | ------- 10 GND 112 | ``` 113 | 114 | ### Internal expansion connector 115 | I only have the RS41-SG version (without additional pressure sensor board), so the PCBs only contain a footprint for soldering one. I bet that the pinout is the same, desciription can be found in the *radiosonde_hardware*. 116 | 117 | ### NFC interface 118 | Besides the lack of the `C604` capacitor (but the footprint is still there?) the circuit looks the same as the one before.
119 | I had no luck for now to implement some decent protocol, because the board doesn't feature any NFC frontend (which means carrier OOK modulation for rx by the sonde and rfid load changing as a tx from sonde).
120 | 121 | The only thing that it is capable for now (via the hardware side) is that the sonde can be instantly turned ON on detection of the 13.56MHz RFID carrier. You can try this with your NFC-capable smartphone - just turn on the NFC function (the one for the RFID cards) and stick the back of your phone to the back of the sonde or somewhere near the coil on the bottom. The lights should turn ON and the sonde should start working. 122 | 123 | 124 | ## Final hardware words 125 | If you didn't find an answer for your question about the sonde hardware in this text, please visit the previously mentioned *radiosonde_hardware*, which provides more detailed descriptions of some components.
126 | Feel free to ask in the issues here about any features :) 127 | 128 | [def]: #power-supply 129 | -------------------------------------------------------------------------------- /hw/photos/front.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/hw/photos/front.JPG -------------------------------------------------------------------------------- /hw/photos/rear.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/hw/photos/rear.JPG -------------------------------------------------------------------------------- /hw/photos/rs41-rsm414_uC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Nevvman18/rs41-nfw/f4baf555d1a3ad67a2c8f27c6bba39215231a2bd/hw/photos/rs41-rsm414_uC.png --------------------------------------------------------------------------------