The KW40Z connectivity software stack has several demo application available, and one of them is the OTAP client. This application allows the user to reprogram the device in a wireless fashion. This can be done by both using another device with an OTAP server application, or with the Kinetis BLE Toolbox mobile application, using the OTAP tool.
To create a binary file for the KW40Z, follow these next steps:
- Using IAR Embedded Workbench, open the application you want to send through OTAP.
- Right click the main project, and open the Options... menu.
![1.png 1.png](/t5/image/serverpage/image-id/36775i4809ADB7322655FC/image-size/large?v=v2&px=999)
- In the options menu, go to the Output Converter submenu. In the Output Converter submenu, check the "Generate additional output" box, and choose Motorola as the Output format.
![1.png 1.png](/t5/image/serverpage/image-id/36852iD4FF9074846E3E82/image-size/large?v=v2&px=999)
- In the options menu, go to the Linker submenu. Now, in the Config tab, replace the symbols in the Configuration file symbol definitions box with these:
- gUseNVMLink_d=1
- gUseBootloaderLink_d=1
- gUseInternalStorageLink_d=0
- __ram_vector_table__=1
![1.png 1.png](/t5/image/serverpage/image-id/36899i1DE5475EFDAC671D/image-size/large?v=v2&px=999)
- In the Linker submenu, go to the Input tab. In the Keep symbols box, add the symbol 'bootloader' (without the quotes).
- In the Input tab, in the Raw binary image box, in the File option, add the following path:
- $PROJ_DIR$\..\..\..\..\..\..\..\framework\Bootloader\Bin\BootloaderOTAP_KW40Z4.bin
- In the Raw binary image box, add the following options to the Symbol, Section and Align boxes:
- Symbol: bootloader
- Section: .bootloader
- Align: 4
![1.png 1.png](/t5/image/serverpage/image-id/36948i47DB3EABE031A0BA/image-size/large?v=v2&px=999)
- Press OK. Compile the project. The output file (*.srec) should be in the main project folder, inside the debug folder.
![1.png 1.png](/t5/image/serverpage/image-id/36991i5D2675C2766AA4F2/image-size/large?v=v2&px=999)
- You can now use this binary file to reprogram your device with OTAP.