Skip to content

Commit 2e3624c

Browse files
committed
[gen2][supply secure] protobuf, dynalib and docs
1 parent 4927b86 commit 2e3624c

File tree

7 files changed

+47
-74
lines changed

7 files changed

+47
-74
lines changed

docs/artifacts.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ Artifact Name Composition
88

99
|artifact name|@|semantic version|.|file extension|
1010
|:-:|:-:|:-:|:-:|:-:|
11-
|electron-bootloader|@|1.0.1-rc.1+lto.debug.jtag|.|bin|
11+
|boron-bootloader|@|1.0.1-rc.1|.|bin|
1212

13-
**E.g.** `electron[email protected]+lto.debug.jtag.bin`
13+
**E.g.** `boron[email protected]`
1414

1515
#### Filename Composition
1616

1717
- Artifact Name
18-
- Platform Name (`electron`)
18+
- Platform Name (`boron`)
1919
- Module Name (`bootloader`)
2020
- Semantic Version
2121
- Major Version (`1`)
@@ -43,9 +43,9 @@ Folder Hierarchy
4343

4444
|evaluated semantic version|/|platform|/|binary descriptor|
4545
|:-:|:-:|:-:|:-:|:-:|
46-
|1.0.1|/|electron|/|debug|
46+
|1.0.1|/|boron|/|debug|
4747

48-
**E.g.** `1.0.1/electron/debug`
48+
**E.g.** `1.0.1/boron/debug`
4949

5050
### Hierarchical Composition
5151

@@ -54,17 +54,17 @@ Folder Hierarchy
5454
- Minor Version (`0`)
5555
- Patch Version (`1`)
5656
- [_OPTIONAL_] Pre-release Tag (_none_)
57-
- Platform Name (`electron`)
57+
- Platform Name (`boron`)
5858
- Binary Descriptor (`debug`)
5959

6060
Zip Artifacts
6161
-------------
6262

6363
|company|_|product|@|evaluated semantic version|+|platform|.|content|.|file_extension|
6464
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
65-
|particle|_|device-os|@|1.0.1|+|electron|.|binaries|.|zip|
65+
|particle|_|device-os|@|1.0.1|+|boron|.|binaries|.|zip|
6666

67-
**E.g.** `[email protected]+electron.binaries.zip`
67+
**E.g.** `[email protected]+boron.binaries.zip`
6868

6969
### Zip Filename Composition
7070

@@ -77,7 +77,7 @@ Zip Artifacts
7777
- Patch Version (`1`)
7878
- [_OPTIONAL_] Prerelease Tag (_none_)
7979
- Filter
80-
- [_OPTIONAL_] Platform Name (`electron`)
80+
- [_OPTIONAL_] Platform Name (`boron`)
8181
- [_OPTIONAL_] Content Type (`binaries`)
8282
- File Extension (`bin`)
8383

docs/build.md

+21-52
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ When building firmware, it's a good idea to build from `main`, since this offers
3535
additional features compared to building in the root directory, such as `program-dfu` to flash
3636
the produced firmware to the device.
3737

38-
## Updating System Firmware (Photon)
38+
## Updating System Firmware (Boron)
3939

40-
When building locally on the photon from the develop branch, it is necessary
40+
When building locally on the boron from the develop branch, it is necessary
4141
to update the system firmware to the latest version:
4242

43-
- put the Photon in DFU mode
43+
- put the Boron in DFU mode
4444
- `cd modules`
45-
- `make PLATFORM=photon clean all program-dfu`
45+
- `make clean all -s PLATFORM=boron program-dfu`
4646
- You can optionally add `APP`/`APPDIR`/`TEST` values to the command above to build a specific application as you would when building `main`.
4747

4848
This will flash the latest system modules and the application to your device.
4949

50-
A key indicator that this is necessary is that the Photon doesn't run your application
50+
A key indicator that this is necessary is that the Boron doesn't run your application
5151
after flashing, due to a version mismatch. The onboard LED will breathe magenta
5252
to indicate Safe Mode when the application firmware isn't run.
5353

@@ -103,13 +103,11 @@ common are listed here:
103103
| Name | PLATFORM_ID |
104104
|----------|:-----------:|
105105
| gcc | 3 |
106-
| photon | 6 |
107-
| p1 | 8 |
108-
| electron | 10 |
109106
| argon | 12 |
110107
| boron | 13 |
111108
| bsom | 23 |
112109
| b5som | 25 |
110+
| tracker | 26 |
113111

114112
The platform is specified on the command line using the platform ID
115113

@@ -126,23 +124,23 @@ PLATFORM=name
126124
For example
127125

128126
```
129-
make PLATFORM=photon
127+
make PLATFORM=boron
130128
```
131-
Would build the firmware for the Photon / P0.
129+
Would build the firmware for the Boron.
132130

133131
To avoid repeatedly specifying the platform on the command line, it can be set
134132
as an environment variable.
135133

136134
Linux/OS X:
137135

138136
```
139-
export PLATFORM=photon
137+
export PLATFORM=boron
140138
```
141139

142140
Windows
143141

144142
```
145-
set PLATFORM=photon
143+
set PLATFORM=boron
146144
```
147145

148146
In the commands that follow, we avoid listing the PLATFORM explicitly to keep
@@ -351,7 +349,7 @@ External Particle libraries can be compiled and linked with firmware. To add one
351349
2. remove the `examples` directory if it exists
352350
```
353351
cd /particle/libs/neopixel
354-
rm -rf firmware/examples
352+
rm -rf device-os/examples
355353
```
356354

357355
3. Rename `firmware` to be the same as the library name.
@@ -427,31 +425,6 @@ the device will then automatically enter DFU mode and flash the firmware.
427425
(Tested on OS X. Should work on other platforms that provide the `stty` command.)
428426

429427

430-
## Flashing the firmware to the device via ST-Link
431-
432-
The `st-flash` target can be used to flash all executable code (bootloader, main and modules)
433-
to the device. The flash uses the `st-flash` tool, which should be in your system path.
434-
435-
# Debugging
436-
437-
To enable JTAG debugging, add this to the command line:
438-
439-
```
440-
USE_SWD_JTAG=y
441-
```
442-
443-
and perform a clean build.
444-
445-
To enable SWD debugging only (freeing up 2 pins) add:
446-
447-
```
448-
USE_SWD=y
449-
```
450-
451-
and perform a clean build. For more details on SWD-only debugging
452-
see https://github.com/spark/firmware/pull/337
453-
454-
455428
## Building the `develop` branch
456429

457430
Before the 0.4.0 firmware was released, we recommended the develop branch for early adopters to obtain the code. This is still fine for early adopters, and people that want the bleeding edge, although please keep in mind the code is untested and unreleased.
@@ -464,36 +437,32 @@ Pre-releases are available in `release/vx.x.x-rc.x` branches. Default released
464437
- The variables passed to make can also be provided as environment variables,
465438
so you avoid having to type them out for each build. The environment variable value can be overridden
466439
by passing the variable on the command line.
467-
- `PLATFORM` set in the environment if you mainly build for one platform, e.g. the Photon.
440+
- `PLATFORM` set in the environment if you mainly build for one platform, e.g. the Boron.
468441

469-
### Photon
442+
### Boron
470443

471-
Here are some common recipes when working with the photon. Note that `PLATFORM=photon` doesn't need to be present if you have `PLATFORM=photon` already defined in your environment.
444+
Here are some common recipes when working with the boron. Note that `PLATFORM=boron` doesn't need to be present if you have `PLATFORM=boron` already defined in your environment.
472445

473446
```
474447
# Complete rebuild and DFU flash of latest system and application firmware
475-
firmware/modules$ make clean all program-dfu PLATFORM=photon
448+
device-os/modules$ make clean all program-dfu PLATFORM=boron
476449
477450
# Incremental build and flash of latest system and application firmware
478-
firmware/modules$ make all program-dfu PLATFORM=photon
479-
480-
# Build system and application for use with debugger (Programmer Shield)
481-
# APP/APPDIR can also be specified here to build the non-default application
482-
firmware/modules$ make clean all program-dfu PLATFORM=photon USE_SWD_JTAG=y
451+
device-os/modules$ make all program-dfu PLATFORM=boron
483452
484-
# Incremental build and flash user application.cpp only (note the directory)
485-
firmware/main$ make all program-dfu PLATFORM=photon
453+
# Incremental build and flash user application.cpp only (note the main/ directory)
454+
device-os/main$ make all program-dfu PLATFORM=boron
486455
487456
# Build an external application
488-
firmware/modules$ make all PLATFORM=photon APPDIR=~/my_app
457+
device-os/modules$ make all PLATFORM=boron APPDIR=~/my_app
489458
```
490459

491460
For system firmware developers:
492461

493462
```
494463
# Rebuild and flash the primary unit test application
495-
firmware/main$ make clean all program-dfu TEST=wiring/no_fixture PLATFORM=photon
464+
device-os/main$ make clean all -s TEST=wiring/no_fixture PLATFORM=boron program-dfu
496465
497466
# Build the compilation test (don't flash on device)
498-
firmware/main$ make TEST=wiring/api PLATFORM=photon
467+
device-os/main$ make clean all -s TEST=wiring/api PLATFORM=boron
499468
```

docs/debugging.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ The firmware includes a debugging aid that enables debug output, from the system
66
To create a debug build, add `DEBUG_BUILD=y` to the `make` command line. If the previous build was not a debug build then
77
you should add `clean` to perform a clean build.
88

9-
On the photon, the system modules must also be rebuilt also with `DEBUG_BUILD` set.
9+
On the device, the system module(s) must also be rebuilt also with `DEBUG_BUILD` set.
1010

1111
Since 0.6.0 the firmware includes newer logging framework. The system API is described in the services/inc/logging.h file. The application API is described in the firmware reference: docs/reference/firmware.md

docs/dependencies.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Building the firmware locally requires these dependencies ot be installed:
1010
6. [Command line tools](#6-command-line-tools)
1111

1212
#### 1. GCC for ARM Cortex processors
13-
The Photon uses an ARM Cortex M3 CPU based microcontroller. All of the code is built around the GNU GCC toolchain offered and maintained by ARM.
13+
Particle devices use an ARM Cortex Mx CPU based microcontroller. All of the code is built around the GNU GCC toolchain offered and maintained by ARM.
1414

1515
The build requires version 10.2.1 (10-2020-q4-major) or newer of ARM GCC and will print an error
1616
message if the version is older than this.

docs/gettingstarted.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Open up a terminal window, and switch branch to 'release/stable'
4040
Navigate to the `modules` folder under firmware
4141
(i.e. `cd firmware/modules`) and type:
4242

43-
make clean all PLATFORM=photon -s program-dfu
43+
make clean all -s PLATFORM=boron program-dfu
4444

4545
This will clean build the system firmware and the default main application (`firmware/user/src/application.cpp`) which contains Tinker, but you may overwrite this with your own application and add any required dependencies. The `-s` silences the verbose output, so be patient while it builds. If your device is in DFU mode, it will then download the 3 binaries one at a time. For more custom application location solutions, see the [makefile documentation](build.md) and learn how to use the `APP=myapp` option.
4646

@@ -80,7 +80,7 @@ the various libraries that make up the firmware.
8080
| **wiring** | the Wiring API |
8181
| **user** | contains the default application code (Tinker) and your own applications |
8282
| **main** | top-level project to build the firmware for a device |
83-
| **modules** | dynamically linked modules for the Photon/PØ/P1 |
83+
| **modules** | dynamically linked modules |
8484

8585
Within each library, the structure is
8686

@@ -115,14 +115,15 @@ A flash of white then flashing green can happen when you get this wrong. You wan
115115
2. Open up a terminal window on your computer and type this command to find out if the device indeed being detected correctly.
116116

117117
`dfu-util -l`
118-
you should get something similar to this in return:
118+
you should get something similar to this in return (e.g. for Boron):
119119
```
120-
Found DFU: [1d50:607f] devnum=0, cfg=1, intf=0, alt=0, name="@Internal Flash /0x08000000/20*001Ka,108*001Kg"
121-
Found DFU: [1d50:607f] devnum=0, cfg=1, intf=0, alt=1, name="@SPI Flash : SST25x/0x00000000/512*04Kg"
120+
Found DFU: [2b04:d00d] ver=0251, devnum=18, cfg=1, intf=0, path="0-3.4.2", alt=2, name="@External Flash /0x80000000/1024*004Kg", serial="123412341234123412341234"
121+
Found DFU: [2b04:d00d] ver=0251, devnum=18, cfg=1, intf=0, path="0-3.4.2", alt=1, name="@DCD Flash /0x00000000/1*016Ke", serial="123412341234123412341234"
122+
Found DFU: [2b04:d00d] ver=0251, devnum=18, cfg=1, intf=0, path="0-3.4.2", alt=0, name="@Internal Flash /0x00000000/1*004Ka,47*004Kg,192*004Kg,4*004Kg,4*004Kg,8*004Ka", serial="123412341234123412341234"
122123
```
123124

124125
- Windows users will need to use the Zatig utility to replace the USB driver as described earlier
125-
- Linux users who encounter someting like: `dfu-util: Cannot open DFU device 2b04:d00a` can try `sudo dfu-util -l` or if you use the Particle CLI command `particle flash --usb` or `particle update` it will add the device udev rules automatically for you.
126+
- Linux users who encounter someting like: `dfu-util: Cannot open DFU device 2b04:d00d` can try `sudo dfu-util -l` or if you use the Particle CLI command `particle flash --usb` or `particle update` it will add the device udev rules automatically for you.
126127

127128

128129
3. Now, from the `main/` folder in your firmware repository and use the following command to transfer the *.bin* file into the device.
@@ -138,4 +139,4 @@ the `dfu-util` command. You can ignore this message for now. We're not sure wha
138139

139140
* If you are having trouble with dfu-util, (like invalid dfuse address), try a newer version of dfu-util. v0.7 works well.
140141

141-
**Still having troubles?** Checkout our [resources page](https://www.particle.io/resources), hit us up on IRC, etc.
142+
**Still having troubles?** Checkout our [Docs](https://docs.particle.io/).

dynalib/inc/module_info.inc

+5-4
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,15 @@
2323
*/
2424

2525
#include "module_info.h"
26+
#include "platforms.h"
2627

27-
#if PLATFORM_ID==3 || PLATFORM_ID == 20
28+
#if PLATFORM_ID == PLATFORM_GCC
2829
#define _ARM_SECTION(x)
2930
char link_module_start;
3031
char link_module_end;
3132
#else
3233
#define _ARM_SECTION(x) ,x
33-
#endif
34+
#endif // PLATFORM_ID == PLATFORM_GCC
3435

3536

3637
module_function_t module_function_(uint8_t f) {
@@ -115,7 +116,7 @@ extern char link_module_end;
115116
#error MODULE_DEPENDENCY2 not defined
116117
#endif
117118

118-
#if PLATFORM_ID!=3
119+
#if PLATFORM_ID != PLATFORM_GCC
119120
__attribute__((section(".modinfo.module_info"), used))
120121

121122
const module_info_t module_info = {
@@ -150,4 +151,4 @@ __attribute__((section(".modinfo.module_info_crc"), used)) const module_info_crc
150151
}
151152
#endif // __cplusplus
152153

153-
#endif
154+
#endif // PLATFORM_ID != PLATFORM_GCC

dynalib/src/readme.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Module Info
22

3+
> TODO: Update for Gen3
4+
35
The `module_info.h` file describes the structure of the block of metadata (module info) that is
46
inserted into modules supporting self-describing memory location and CRC checks.
57

0 commit comments

Comments
 (0)