Skip to content

boards/pba-d-01-kw2x: add riotboot support#11642

Merged
cladmi merged 2 commits intoRIOT-OS:masterfrom
fjmolinas:pr_riotboot_kw2x
Jun 6, 2019
Merged

boards/pba-d-01-kw2x: add riotboot support#11642
cladmi merged 2 commits intoRIOT-OS:masterfrom
fjmolinas:pr_riotboot_kw2x

Conversation

@fjmolinas
Copy link
Contributor

@fjmolinas fjmolinas commented Jun 6, 2019

Contribution description

This PR adds riotboot support or pba-d-01-kw2x.

Testing procedure

Run riotboot tests and everything should work as expected.

BOARD=pba-d-01-kw2xFEATURES_REQUIRED+=riotboot make -C tests/xtimer_usleep riotboot/flash-extended-slot0 term

BOARD=pba-d-01-kw2x FEATURES_REQUIRED+=riotboot make -C tests/xtimer_usleep riotboot/flash-slot1 term

Issues/PRs references

Related to #11641

@fjmolinas fjmolinas added Type: new feature The issue requests / The PR implemements a new feature for RIOT Area: OTA Area: Over-the-air updates labels Jun 6, 2019
@fjmolinas fjmolinas requested review from aabadie and cladmi June 6, 2019 09:48
fjmolinas added 2 commits June 6, 2019 11:59
- Minimum required RIOBOOT_HDR_LEN or kW2xD is 0x200
  to respect vector table alignment
@fjmolinas fjmolinas added State: waiting for other PR State: The PR requires another PR to be merged first CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed State: waiting for other PR State: The PR requires another PR to be merged first labels Jun 6, 2019
Copy link
Contributor

@cladmi cladmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with the changes, the commits and description for the vector alignments required. There is enough information for understanding in the future.

I successfully tested tests/xtimer_usleep and tests/riotboot with the board using:

BOARD=pba-d-01-kw2x FEATURES_REQUIRED+=riotboot APP_VER=$(date +%s) make -C tests/xtimer_usleep clean riotboot/flash-extended-slot0 term
# I get the terminal output without crash
2019-06-06 14:25:23,443 - INFO # Slept for 98780 us (expected: 98765 us) Offset: 15 us
2019-06-06 14:25:23,522 - INFO # Slept for 75016 us (expected: 75000 us) Offset: 16 us
2019-06-06 14:25:23,537 - INFO # Slept for 10016 us (expected: 10000 us) Offset: 16 us
2019-06-06 14:25:23,592 - INFO # Slept for 50016 us (expected: 50000 us) Offset: 16 us
2019-06-06 14:25:23,606 - INFO # Slept for 10249 us (expected: 10234 us) Offset: 15 us
2019-06-06 14:25:23,668 - INFO # Slept for 56795 us (expected: 56780 us) Offset: 15 us
2019-06-06 14:25:23,685 - INFO # Slept for 12137 us (expected: 12122 us) Offset: 15 us
2019-06-06 14:25:23,788 - INFO # Slept for 98780 us (expected: 98765 us) Offset: 15 us
2019-06-06 14:25:23,868 - INFO # Slept for 75016 us (expected: 75000 us) Offset: 16 us
2019-06-06 14:25:23,870 - INFO # Test ran for 1727087 us
2019-06-06 14:27:00,991 - INFO # Exiting Pyterm


BOARD=pba-d-01-kw2x APP_VER=$(date +%s) make -C tests/riotboot riotboot/flash-slot1 test
# Test succeed
2019-06-06 14:27:15,629 - INFO # Hello riotboot!
2019-06-06 14:27:15,633 - INFO # You are running RIOT on a(n) pba-d-01-kw2x board.
2019-06-06 14:27:15,636 - INFO # This board features a(n) kinetis MCU.
2019-06-06 14:27:15,639 - INFO # riotboot_test: running from slot 1
2019-06-06 14:27:15,642 - INFO # Image magic_number: 0x544f4952
2019-06-06 14:27:15,644 - INFO # Image Version: 0x5cf9069e
2019-06-06 14:27:15,647 - INFO # Image start address: 0x00020a00
2019-06-06 14:27:15,649 - INFO # Header chksum: 0xa2e00b3b
2019-06-06 14:27:15,650 - INFO #
> 2019-06-06 14:27:15,805 - INFO #  curslotnr
2019-06-06 14:27:15,806 - INFO # Current slot=1
> curslothdr
2019-06-06 14:27:15,860 - INFO #  curslothdr
2019-06-06 14:27:15,863 - INFO # Image magic_number: 0x544f4952
2019-06-06 14:27:15,865 - INFO # Image Version: 0x5cf9069e
2019-06-06 14:27:15,868 - INFO # Image start address: 0x00020a00
2019-06-06 14:27:15,870 - INFO # Header chksum: 0xa2e00b3b
2019-06-06 14:27:15,870 - INFO #
> getslotaddr 0
2019-06-06 14:27:15,924 - INFO #  getslotaddr 0
2019-06-06 14:27:15,927 - INFO # Slot 0 address=0x00001200
> dumpaddrs
2019-06-06 14:27:15,981 - INFO #  dumpaddrs
2019-06-06 14:27:15,984 - INFO # slot 0: metadata: 0x1000 image: 0x00001200
2019-06-06 14:27:15,988 - INFO # slot 1: metadata: 0x20800 image: 0x00020a00
>

# Reset app version on second slot
BOARD=pba-d-01-kw2x FEATURES_REQUIRED+=riotboot APP_VER=1 make -C tests/riotboot riotboot/flash-slot1 term
# I get the terminal output again
2019-06-06 14:27:33,498 - INFO # Slept for 98780 us (expected: 98765 us) Offset: 15 us
2019-06-06 14:27:33,499 - INFO # Slept for 75016 us (expected: 75000 us) Offset: 16 us
2019-06-06 14:27:33,499 - INFO # Slept for 10016 us (expected: 10000 us) Offset: 16 us
2019-06-06 14:27:33,500 - INFO # Slept for 50016 us (expected: 50000 us) Offset: 16 us
2019-06-06 14:27:33,501 - INFO # Slept for 10250 us (expected: 10234 us) Offset: 16 us
2019-06-06 14:27:33,513 - INFO # Slept for 56795 us (expected: 56780 us) Offset: 15 us
2019-06-06 14:27:33,530 - INFO # Slept for 12137 us (expected: 12122 us) Offset: 15 us
2019-06-06 14:27:33,634 - INFO # Slept for 98780 us (expected: 98765 us) Offset: 15 us
2019-06-06 14:27:33,713 - INFO # Slept for 75016 us (expected: 75000 us) Offset: 16 us
2019-06-06 14:27:33,728 - INFO # Slept for 10016 us (expected: 10000 us) Offset: 16 us
2019-06-06 14:27:33,782 - INFO # Slept for 50016 us (expected: 50000 us) Offset: 16 us
2019-06-06 14:27:33,797 - INFO # Slept for 10250 us (expected: 10234 us) Offset: 16 us
2019-06-06 14:27:33,859 - INFO # Slept for 56795 us (expected: 56780 us) Offset: 15 us
2019-06-06 14:27:33,876 - INFO # Slept for 12137 us (expected: 12122 us) Offset: 15 us
2019-06-06 14:27:33,979 - INFO # Slept for 98780 us (expected: 98765 us) Offset: 15 us
2019-06-06 14:27:34,059 - INFO # Slept for 75016 us (expected: 75000 us) Offset: 16 us
2019-06-06 14:27:34,061 - INFO # Test ran for 1727080 us

@cladmi cladmi merged commit cca2031 into RIOT-OS:master Jun 6, 2019
@MrKevinWeiss MrKevinWeiss added the Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer label Jun 13, 2019
@fjmolinas fjmolinas deleted the pr_riotboot_kw2x branch August 7, 2019 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: OTA Area: Over-the-air updates CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Type: new feature The issue requests / The PR implemements a new feature for RIOT

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants