Kernel Products
smxBSP™
Board Support Package
smxBSP provides startup code and the low-level functions required for the smx® kernel and other SMX products to run on specific boards and processors. It also provides project files and other tool-support files, plus detailed BSP notes.
An smxBSP is included with smx for each board supported. (See www.smxrtos.com/eval for a complete list.) If your board is not directly supported, we provide the closest smxBSP as a porting guide. The smx kernel and other SMX RTOS products have well-defined porting layers for supporting new processors. See the psmx datasheet, smx Porting Guide, and other datasheets and manuals for more information.
BSP Code and Device Drivers
Usually we begin with startup and BSP code provided by the processor or board vendor and add any modifications needed for SMX. A UART driver and code to initialize a timer for the smx tick are included. Other SMX RTOS products (e.g. smxFS, smxNS, and smxUSB) have drivers for on-chip peripherals and also for external controller chips. The vendor often provides driver source code for other, specialized peripherals (e.g. CAN and I2C).
Tool Support
A project file is included to build the smx Protosystem for the target board. It uses the proper options and defines, and it links all needed files and SMX product libraries. It has Debug, Release, and ROM build targets, and linker/locator scripts for each case. It also includes debug configuration files necessary to pre-initialize the board before the debugger downloads code to it. In short, all files are provided that are necessary to build and run the smx Protosystem on the target board, out of the box.
BSP Notes
smxBSP includes a detailed BSP notes file for the particular target board and tool suite, which gives specific details about the BSP and configuration. It has tables showing IRQ assignments, memory maps for Debug, Release, and ROM build targets, and clock/PLL configuration. It summarizes the peripherals on the processor/board and points to the SMX drivers for each that is supported, and it has sections for each SMX product that runs on the board. It documents hardware and tool issues, and it gives instructions for using related tools such as flash programmers. We put a lot of effort into creating and updating these notes; they are an invaluable reference for us too. Each SMX Evaluation Kit includes the BSP notes for that board.
Supporting a New Board
In order to ease the job of moving SMX to a new board or processor, we have formalized the API for smxBSP. The API is listed in the next section. To support a new board or processor with SMX, it is necessary only to implement the required smxBSP functions. In many cases this consists of merely copying needed functions and making minor changes. This is especially true when moving from a vendor-supplied development board to a custom board using the same processor.
smxBSP API
The following API has evolved from supporting numerous processors in the ARM, Cortex, and ColdFire processor families. It encompasses the considerable variety of ways in which interrupts, traps, timers, memory, console, boot, and exit are handled and works quite well. See the smxBase User's Guide for details about each function.
In the following, IRQ represents a hardware interrupt, whereas interrupt represents either a hardware or software interrupt (i.e. an exception). IRQ configuration is done in a single array, called irq_table[]. Each element of the table has fields for priority, interrupt vector number, and any other details related to configuring IRQs for the processor. Centralizing this information helps prevent double-assignment of interrupt priorities and vector numbers, and it simplifies the parameter lists of some API calls. Any BSP function that needs interrupt information gets it from irq_table[].
Interrupt Handling Functions
sb_IntCtrlInit()
sb_IntStateRestore(prev_state)
sb_IntStateSaveDisable()
sb_IntTrapVectSet(int_num, isr_ptr)
sb_IntVectGet(int_num, extra_info)
sb_IntVectSet(int_num, isr_ptr)
sb_IRQClear(irq_num)
sb_IRQConfig(irq_num)
sb_IRQEnd(irq_num)
sb_IRQMask(irq_num)
sb_IRQUnmask(irq_num)
sb_IRQsMask()
sb_IRQsUnmask()
sb_IRQToInt(irq_num)
sb_IRQVectGet(irq_num, xtra_info)
sb_IRQVectSet(irq_num, isr_ptr)
Memory Functions
sb_DMABufferAlloc(num_bytes)
sb_DMABufferFree(buffer)
sb_HeapSpaceGet(size, flag, heap)
Time Functions
sb_ClocksInit()
sb_DelayMsec(num)
sb_DelayUsec(num)
sb_TickInit()
sb_SetStime()
Miscellaneous Functions
sb_ConsoleInInit()
sb_ConsoleOutInit()
sb_Exit(retcode)
sb_PeripheralsInit()
sb_Reboot()
sb_Restart()
|