[riot-notifications] [RIOT-OS/RIOT] cpu/cortexm_common: function to check address validity (#11358)

Francisco notifications at github.com
Mon Apr 8 18:42:25 CEST 2019


### Contribution description

This PR retakes the work done in #10051. The PR was ready to merge except for missing white-list in the new test. As discussed in #10051, this is exactly the same PR but adding some boards to the test white-list. The rest of the PR description is as it was in the original one from @olegart.

Adds extremely useful function to check memory addresses for validity on Cortex-M3/M4/M7 MCUs.

Can be used to determine memory sizes, peripherals availability, etc. in run-time to build firmware that runs effectively on a different MCUs without recompiling.

### Testing procedure
Build and run tests/cpu_cortexm_address_check for your board, then type 'check address' in the shell, where address is a memory address in hex notation (with '0x' prefix). Check your MCUs' datasheet for memory map.

E.g. on STM32L152RET6:

check 0x1FF02000
Address 0x1ff02000 is NOT valid. Accessing it will result in BusFault

check 0x1FF01999
Address 0x1ff01999 is valid. Feel free to access it

(0x1FF01999 is an upper address of the System Memory section)

### Issues/PRs references

#10051
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * cpu/cortexm_common: function to check address validity

-- File Changes --

    M cpu/cortexm_common/cortexm_init.c (47)
    M cpu/cortexm_common/include/cpu.h (11)
    M cpu/cortexm_common/vectors_cortexm.c (18)
    A tests/cpu_cortexm_address_check/Makefile (16)
    A tests/cpu_cortexm_address_check/README.md (12)
    A tests/cpu_cortexm_address_check/main.c (65)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11358.patch
https://github.com/RIOT-OS/RIOT/pull/11358.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/11358
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190408/e8e87f89/attachment.html>


More information about the notifications mailing list