From 9205a742ee8d91f1b86b6c744db18b9622764a78 Mon Sep 17 00:00:00 2001 From: Kelvin Lawson Date: Wed, 17 Feb 2010 00:49:29 +0000 Subject: [PATCH] STM8 Readme: Add page0 null pointer check notes. --- ports/stm8/README | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ports/stm8/README b/ports/stm8/README index 05fc708..9d4c90e 100644 --- a/ports/stm8/README +++ b/ports/stm8/README @@ -347,6 +347,17 @@ your calculations. As mentioned previously, this RAM layout is only the one utilised by the test applications. You may choose whatever layout you like. +Note that on this platform data can be placed at address 0x0, but the +Atomthreads kernel performs validity checks on pointers to ensure they +are not NULL pointers (point to address 0x0). For this reason the +example projects (STVD and Makefile) force the linker to not use address +0x0 and instead start the page0 space at 0x2. This ensures that the +linker does not place any data at address 0x0, and hence all NULL-ptr +checks are still suitable checks for valid pointers. This does, however, +waste 2 bytes. For your own projects you can force this within STVD by +editing the project linker settings (Input -> Zero Page start at 0x2) +or by editing the linker .LKF file as can be seen in atomthreads.lkf. + ---------------------------------------------------------------------------