Setting up and using the mbed Classic site for OSHChip
The long term plan is to have OSHChip registered as an mbed enabled platform, but until that is done, the following describes how to get started with mbed and OSHChip, using a simple blinky example.
- To try it out, you should go to the Classic mbed web site and create an account if you don’t already
- After logging in, select Compiler in the top right corner.
- Click on the Import button
- Select the program tab, and type OSHChip_Blinky in the search box, and click Search
- Double click on the result line, select “import as program” and either accept or modify the import name, then click Import.
- Read the 3 files to understand what is going on.
- Confirm that the target board selected is nRF51-DK (Default) in the top right corner of the page.
- Click the compile button. Compilation should only take a few seconds, then you should be presented with a HEX file to be saved. (OSHChip_Blinky_NRF51_DK.hex if you didn’t change the project name in step 5 above)
- Save this to the USB drive for the OSHChip_CMSIS_DAP. This should load the program into the Flash memory in OSHChip, and then the program should run and blink the 3 on-board LEDs.
Basically, what is going on here is that you tell the mbed system that you are using the nRF51-DK board (from Nordic Semiconductor) that uses the same processor chip as OSHChip. Then as you can see in the example project, there is a replacement header file that is OSHChip specific, and a trivial initialization function that re-assigns the UART to pins 1 and 2 of OSHChip.
The resulting HEX file is surprisingly large (if you save it to a normal disk drive, you will see that it is 320 KB. This is because with mbed, the hex file always includes the SoftDevice for Bluetooth Low Energy (BLE), regardless of whether you are using BLE or not. This means that download time to OSHChip is a few seconds longer than if the SoftDevice was not part of the HEX file.