Skip to content

Commit 57450e1

Browse files
Merge pull request #289 from microbit-foundation/kl27
Add KL27 addresses and blhost instructions
2 parents bda870d + f426ded commit 57450e1

File tree

3 files changed

+35
-10
lines changed

3 files changed

+35
-10
lines changed

hardware/i2c.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ The external lines run to the edge connector and can be used for accessories.
2323

2424
### Table of addresses used
2525

26-
| | accelerometer | magnetometer (compass) | KL27 |
27-
|---------------------|------------------|------------------------|
28-
| motion sensor variant 1 (LSM303AGR) | 0x19 (0x32/0x33) | 0x1E (0x3C/0x3D) | TBC
29-
| motion sensor variant 2 (FXOS8700CQ) | 0x1F (0x3E/0x3F) | 0x1F (0x3E/0x3F) | TBC
26+
| | accelerometer | magnetometer (compass) | KL27 Power Mng | KL27 Storage |
27+
|---------------------|------------------|------------------------|----------------|--------------|
28+
| motion sensor variant 1 (LSM303AGR) | 0x19 (0x32/0x33) | 0x1E (0x3C/0x3D) | 0x70 (0xE0/0xE1) | 0x72 (0xE4/0xE5) |
29+
| motion sensor variant 2 (FXOS8700CQ) | 0x1F (0x3E/0x3F) | 0x1F (0x3E/0x3F) | 0x70 (0xE0/0xE1) | 0x72 (0xE4/0xE5) |
3030

31-
This means 0x1E, 0x1F and 0x19 are reserved for on-board use.
31+
While the micro:bit <span class="v2">V2</span> has a dedicated bus for the on-board I2C peripherals, the micro:bit <span class="v1">V1</span> shares the same bus for on-board and external I2C devices. Please check the [V1 shared bus](../i2c-shared/) documentation to check the reserved I2C addresses.
3232

3333
### Table of address used by micro:bit accessories (please edit)
3434

software/assets/erase-flash.hex

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
:020000040000FA
2+
:10000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
3+
:10001000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0
4+
:10002000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0
5+
:10003000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD0
6+
:10004000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0
7+
:10005000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB0
8+
:10006000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA0
9+
:10007000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF90
10+
:10008000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80
11+
:10009000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF70
12+
:1000A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF60
13+
:1000B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF50
14+
:1000C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF40
15+
:1000D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF30
16+
:1000E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF20
17+
:1000F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF10
18+
:00000001FF

software/interface.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,13 @@ You can also flash a full DAPLink image to the <span class="v2">V2</span> device
124124

125125
[Download latest full DAPLink image](/docs/software/assets/DAPLink-factory-release/kl27z_bl_0255_if_0255_microbit_full_image.bin){: .btn.sm-btn download}
126126

127-
You will need to register for and download the [**Bootloader Host Application (blhost)**](https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuboot-mcu-bootloader-for-nxp-microcontrollers:MCUBOOT?&tab=Design_Tools_Tab) from NXP. IN the /bin folder you will find executables for your operating system.
127+
You will need to register for and download the [**Bootloader Host Application (blhost)**](https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuboot-mcu-bootloader-for-nxp-microcontrollers:MCUBOOT?&tab=Design_Tools_Tab) from NXP. In the `/bin` folder you will find executables for your operating system.
128+
129+
<div class="alert alert-warning">Please ensure the nRF52 flash has been erased before erasing/flashing the KL27 flash. Programmes running on the nRF52 can affect the KL27 internal boot process and stop the kinetis bootloader from running. You can flash an <a href="/docs/software/assets/erase-flash.hex">erase-flash.hex</a> file to erase the nRF52.</div>
128130

129131
### Enter bootloader mode
130132

131-
To enter this mode we need to ground TP1 during board power up, this is the BOOTMODE pin in the KL27. To do that, connect with a wire (or something like a paper-clip) TP1 red circle) with any ground point (black square) as you insert the USB cable into the device.
133+
To enter this mode we need to ground TP1 during board power up, this is the BOOTMODE pin in the KL27. To do that, connect with a wire (or something like a paper-clip) from TP1 (the red circle) with any ground point (any black square) as you insert the USB cable into the device.
132134

133135
![TP1](/docs/software/assets/TP1.png){: width: 300px}
134136

@@ -142,14 +144,19 @@ Usage info:
142144
blhost --help
143145
```
144146

145-
Flash KL27 bin file:
147+
The DAPLink software enables flash protection for the bootloader flash area, so we need to use erase command that also unsecures the flash:
148+
149+
```
150+
blhost -u 0x15a2,0x0073 flash-erase-all-unsecure
151+
```
152+
153+
Then unplug the micro:bit from the computer and plug it again, the KL27 should automatically enter the kinetis bootloader. To flash the bin file:
146154

147155
```
148-
blhost -u 0x15a2,0x0073 flash-erase-all 0
149156
blhost -u 0x15a2,0x0073 write-memory 0x0 kl27_file.bin
150157
```
151158

152-
Read KL27 flash contents into `kl27_flash_dump.bin` file:
159+
To read KL27 flash contents into `kl27_flash_dump.bin` file:
153160

154161
```
155162
blhost -u 0x15a2,0x0073 read-memory 0x0 0x40000 kl27_flash_dump.bin

0 commit comments

Comments
 (0)