nes-proj/cpu/stm32w108
Benoît Thébaudeau 19fd7a3551 Use additive offsets
OR-ing an offset to a base address instead of adding it is dangerous
because it can only work if the base address is aligned enough for the
offset.

Moreover, if the base address or the offset has a value unknown at
compile time, then the assembly instructions dedicated to 'base +
offset' addressing on most CPUs can't be emitted by the compiler because
this would require the alignment of the base address against the offset
to be known in order to optimize 'base | offset' into 'base + offset'.
In that case, the compiler has to emit more instructions in order to
compute 'base | offset' on most CPUs, e.g. on ARM, which means larger
binary size and slower execution.

Hence, replace all occurrences of 'base | offset' with 'base + offset'.
This must become a coding rule.

Here are the results for the cc2538-demo example:
 - Compilation of uart_init():
    * before:
        REG(regs->base | UART_CC) = 0;
        200b78:	f446 637c 	orr.w	r3, r6, #4032	; 0xfc0
        200b7c:	f043 0308 	orr.w	r3, r3, #8
        200b80:	2200      	movs	r2, #0
        200b82:	601a      	str	r2, [r3, #0]

    * now:
        REG(regs->base + UART_CC) = 0;
        200b7a:	2300      	movs	r3, #0
        200b7c:	f8c4 3fc8 	str.w	r3, [r4, #4040]	; 0xfc8

 - Size of the .text section:
    * before:	0x4c7c
    * now:	0x4c28
    * saved:	84 bytes

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
2015-03-28 17:28:15 +01:00
..
dev Network layer configuration: replace UIP_CONF_* with NETSTACK_CONF_WITH_* 2014-12-01 21:02:57 +01:00
e_stdio A massive all-tree automated update of all double inclusion guard #defines that changes from using two underscores as a prefix, which are reserved, to not using two underscores as a prefix 2013-11-24 20:20:11 +01:00
hal Use additive offsets 2015-03-28 17:28:15 +01:00
lib New HAL and SimpleMAC for STM32W108. 2011-03-22 19:35:49 +01:00
simplemac A massive all-tree automated update of all double inclusion guard #defines that changes from using two underscores as a prefix, which are reserved, to not using two underscores as a prefix 2013-11-24 20:20:11 +01:00
small-printf A massive all-tree automated update of all double inclusion guard #defines that changes from using two underscores as a prefix, which are reserved, to not using two underscores as a prefix 2013-11-24 20:20:11 +01:00
board-sensors.h Travis-ci tweaks, added CPUREV to 01 regression test, needed by mbxxx platform 2013-07-12 17:07:04 +02:00
cfs-coffee-arch.c Travis-ci tweaks, added CPUREV to 01 regression test, needed by mbxxx platform 2013-07-12 17:07:04 +02:00
cfs-coffee-arch.h Travis-ci tweaks, added CPUREV to 01 regression test, needed by mbxxx platform 2013-07-12 17:07:04 +02:00
clock.c Fix clock.h warnings caused by multiple, conflicting documentation blocks of clock functions 2015-02-15 21:48:30 +01:00
elfloader-arch.c Travis-ci tweaks, added CPUREV to 01 regression test, needed by mbxxx platform 2013-07-12 17:07:04 +02:00
gnu-stm32w108.ld Fixed mbxxx platform 2013-07-11 17:56:17 +02:00
gnu-stm32w108CC.ld Fixed mbxxx platform 2013-07-11 17:56:17 +02:00
gnu-stm32w108xB.ld Fixed mbxxx platform 2013-07-11 17:56:17 +02:00
gnu.ld Fixed mbxxx platform 2013-07-11 17:56:17 +02:00
iar-cfg-coffee.icf New HAL and SimpleMAC for STM32W108. 2011-03-22 19:35:49 +01:00
iar-cfg.icf New HAL and SimpleMAC for STM32W108. 2011-03-22 19:35:49 +01:00
leds-arch.c Travis-ci tweaks, added CPUREV to 01 regression test, needed by mbxxx platform 2013-07-12 17:07:04 +02:00
Makefile.stm32w108 Set the RAM and flash size based on the CPU configuration for STM32W 2014-04-11 17:41:09 +02:00
mtarch.h A massive all-tree automated update of all double inclusion guard #defines that changes from using two underscores as a prefix, which are reserved, to not using two underscores as a prefix 2013-11-24 20:20:11 +01:00
rand.c Travis-ci tweaks, added CPUREV to 01 regression test, needed by mbxxx platform 2013-07-12 17:07:04 +02:00
README.txt Some little refactor 2013-07-19 16:15:55 +02:00
rtimer-arch.c Travis-ci tweaks, added CPUREV to 01 regression test, needed by mbxxx platform 2013-07-12 17:07:04 +02:00
rtimer-arch.h A massive all-tree automated update of all double inclusion guard #defines that changes from using two underscores as a prefix, which are reserved, to not using two underscores as a prefix 2013-11-24 20:20:11 +01:00
slip-uart1.c Travis-ci tweaks, added CPUREV to 01 regression test, needed by mbxxx platform 2013-07-12 17:07:04 +02:00
uip-arch.c Updated include paths for the moved files under net/ 2014-01-26 23:20:23 +01:00
watchdog.c Travis-ci tweaks, added CPUREV to 01 regression test, needed by mbxxx platform 2013-07-12 17:07:04 +02:00

Building instructions.

In order to build your applications you need to find out the right cpu revision for the board you are using.

Valid STM32W_CPUREV values are CC or xB

Examples:

The MB851RevD board has a cpu with code
stm32w 108CCU7
so CC is your STM32W_CPUREV value and the command is
make TARGET=mbxxx STM32W_CPUREV=CC ...

or

The MB851RevC board has a cpu with code
stm32w 108CBU6
so xB is your STM32W_CPUREV value.
make TARGET=mbxxx STM32W_CPUREV=xB ...


NOTE: if the last word is B you need to use x as wildcard.