[riot-notifications] [RIOT-OS/RIOT] kinetis/fcfield-check*: merge into single file (#11589)

Francisco notifications at github.com
Mon May 27 16:55:27 CEST 2019


<!--
The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.
-->

### Contribution description

<!--
Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes
-->

This PR merges the two existing scripts to check for the fcfield contents on kinetis boards. It also adds to the merged scipt the capacity of checking for bin files.

Regarding flashing at an offset, since the `fcfield` content is only read on reset, we don't care for its content when flashing an Image after 0x410 or 1040, therefore we won't check its content.

### Testing procedure

Modify any value in the fcfield:

 https://github.com/RIOT-OS/RIOT/blob/8fe12bc82cfbb83a90efd018e11c044d0a40696b/cpu/kinetis/fcfield.c#L55-L73

Flash an elf, hex and bin file and see that it is properly checked:

* `make -C examples/hello-world/ BOARD=frdm-kw41z flash`

```
### Flashing Target ###
Danger of bricking the device during flash!
Flash configuration field of /home/francisco/workspace/RIOT/examples/hello-world/bin/frdm-kw41z/hello-world.elf:

/home/francisco/workspace/RIOT/examples/hello-world/bin/frdm-kw41z/hello-world.elf:     file format elf32-littlearm

Contents of section .fcfield:
 0400 ffffffff ffffffff aaffffff feffffff  ................
Abort flash procedure!
pre-flash checks failed, status=1
```

* `FFLAGS='flash $(HEXFILE)' make -C examples/hello-world/ BOARD=frdm-kw41z flash`

```
### Flashing Target ###
Danger of bricking the device during flash!
Flash configuration field of /home/francisco/workspace/RIOT/examples/hello-world/bin/frdm-kw41z/hello-world.hex:

/home/francisco/workspace/RIOT/examples/hello-world/bin/frdm-kw41z/hello-world.hex:     file format ihex

Contents of section .sec1:
 0400 ffffffff ffffffff aaffffff feffffff  ................
Abort flash procedure!
pre-flash checks failed, status=1
```

* `FFLAGS='flash $(BINFILE)' make -C examples/hello-world/ BOARD=frdm-kw41z binfile flash`

### Flashing Target ###
Danger of bricking the device during flash!
Flash configuration field of /home/francisco/workspace/RIOT/examples/hello-world/bin/frdm-kw41z/hello-world.bin:

```
/home/francisco/workspace/RIOT/examples/hello-world/bin/frdm-kw41z/hello-world.bin:     file format binary

Contents of section .data:
 0400 ffffffff ffffffff aaffffff feffffff  ................
Abort flash procedure!
pre-flash checks failed, status=1

```
Remove the changes to fcfield, and repeat the above procedure, no errors will be encountered.

<!--
Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output
-->


### Issues/PRs references

<!--
Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->

Used by #11562 
You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11589

-- Commit Summary --

  * kinetis/fcfield-check*: merge into single file

-- File Changes --

    M boards/common/frdm/Makefile.include (2)
    M boards/mulle/Makefile.include (2)
    M boards/pba-d-01-kw2x/Makefile.include (2)
    D cpu/kinetis/dist/check-fcfield-elf.sh (24)
    D cpu/kinetis/dist/check-fcfield-hex.sh (37)
    A cpu/kinetis/dist/check-fcfield.sh (54)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11589.patch
https://github.com/RIOT-OS/RIOT/pull/11589.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11589
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190527/54900f8d/attachment-0001.html>


More information about the notifications mailing list