During the development of the new Cortex M4 OpenMote we have been working with the Freescale K20 tower module. In this page we describe the main hacks to run OpenWSN stack on it.
SPI to Radio Pins
Other Radio Pins
ISR (IRQ H)
A Mass Storage Device bootloader has been developed so the k20 mote can be plug into the usb port and appear as a flash drive. In that way, by dropping an application to the folder the mote can be flashed.
In this page some of the considerations to develop applications that can be bootloaded are presented.
Memory Map of the Bootloader
The bootloader is placed at the beginning of the flash area. The memory map looks as follow:
Applications that need to be flashed by the bootloader need to define its memory map taking into account that the bootloader is at the beginning of the flash. Basically any application will start at 0xC000
m_interrupts (RX) : ORIGIN = 0x0000C000, LENGTH = 0x000001BC #some space for the interrupt vector
m_text (RX) : ORIGIN = 0x0000C800, LENGTH = 0x0003FBF0 #all flash starting after the bootloader
m_data (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x0000FC00 #63kb ram -- 1kb is kept for isr vector in ram.
m_cfmprotrom (RX) : ORIGIN = 0x0000C400, LENGTH = 0x00000010 #16bytes protected area.
note that the bootloader and the application may use all the available ram since they will never execute at the same time.
The bootloader accepts binary, hex and s19 files. For s19 file there is a restriction on the length of s19 records. The limitation comes from the size of the buffers used by the bootloader to write the flash area. We recommend to use -sreclength 40 in the linker script to create the s19 file with s19 records of an appropriate size.