RIOT-OS / RIOT

RIOT - The friendly OS for IoT
https://riot-os.org
GNU Lesser General Public License v2.1
4.94k stars 1.99k forks source link

Riot Kinetis K64 MCU support - Hexiwear watch example? #7596

Closed Tenderson closed 5 years ago

Tenderson commented 7 years ago

Hi,

I appreciate if there is any example for the Riot OS Kinetis K64 board. I have bought the Hexiwear Watch POWER USER PACK and would like to program it using the RIOT. I wrote a simple blink program, however it is not working. Here is the flashing log:

text data bss dec hex filename 120476 444 8496 129416 1f988 /home/vagrant/RIOT/examples/toggle-led/bin/frdm-k64f/Toggle-LED.elf /home/vagrant/RIOT/dist/tools/openocd/openocd.sh flash-elf

Flashing Target

/home/vagrant/RIOT/examples/toggle-led/bin/frdm-k64f/Toggle-LED.elf is fine. Open On-Chip Debugger 0.10.0 Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : auto-selecting first available session transport "swd". To override use 'transport select '. Info : add flash_bank kinetis kx.flash cortex_m reset_config sysresetreq adapter speed: 1000 kHz Info : CMSIS-DAP: SWD Supported Info : CMSIS-DAP: Interface Initialised (SWD) Info : CMSIS-DAP: FW Version = 1.0 Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1 Info : CMSIS-DAP: Interface ready Info : clock speed 1000 kHz Info : SWD DPIDR 0x2ba01477 START... Info : SWD DPIDR 0x2ba01477 Error: Failed to write memory at 0xe0001058 Info : kx.cpu: hardware has 6 breakpoints, 4 watchpoints Info : MDM: Chip is unsecured. Continuing. TargetName Type Endian TapName State


0* kx.cpu cortex_m little kx.cpu reset START... Info : MDM: Chip is unsecured. Continuing. target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x000007a4 msp: 0x1fff0200 auto erase enabled Info : Probing flash info for bank 0 Warn : Flash Configuration Field written. Warn : Reset or power off the device to make settings effective. wrote 122880 bytes from file /home/vagrant/RIOT/examples/toggle-led/bin/frdm-k64f/Toggle-LED.elf in 10.854154s (11.056 KiB/s) START... Info : MDM: Chip is unsecured. Continuing. target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x000007a4 msp: 0x1fff0200 34 bytes written at address 0x20000000 downloaded 34 bytes in 0.009277s (3.579 KiB/s) target halted due to breakpoint, current mode: Thread xPSR: 0x01000000 pc: 0x20000020 msp: 0x1fff0200 verified 120920 bytes in 2.045297s (57.735 KiB/s) START... Info : MDM: Chip is unsecured. Continuing. shutdown command invoked Done flashing /home/vagrant/RIOT/dist/tools/pyterm/pyterm -p "/dev/ttyACM0" -b "115200" No handlers could be found for logger "root" 2017-09-13 13:19:43,602 - INFO # Connect to serial port /dev/ttyACM0 Welcome to pyterm! Type '/exit' to exit. help tgl

Here is my simple program:

int toggleTest(int argc, char **argv) {
printf("The LED toggle function called to toggle LED0\n"); LED0_TOGGLE; LED1_TOGGLE; return 0; } static const shell_command_t commands[] = { { "tgl", "toggle LED0", toggleTest }, { NULL, NULL, NULL } }; int main(void) { char line_buf[SHELL_DEFAULT_BUFSIZE]; shell_run(commands, line_buf, SHELL_DEFAULT_BUFSIZE); return 0; }

Here is my build command:

make BOARD=frdm-k64f clean all flash term

Any thoughts is appreciated. It would be great to have an example for the Hexiwear watch.

Thank you.

jnohlgard commented 7 years ago

That is an interesting platform. There is no board support for it yet though, so you will have to write a board configuration for it, unless it happens to be identical to the FRDM-K64F board. Do you have all the schematics for the Hexiwear board? You can add it as a new board by creating a copy of boards/frdm-k64f to e.g. boards/hexiwear-k64f (to leave room for a boards/hexiwear-kw40z, for the communications board) I did not look further than the marketing pages for the board, so I wouldn't know anything on how this specific board works, but are you sure that you are working on the main CPU (K64F), and not trying to flash the BLE communication CPU (KW40Z)? Have you configured the correct pins in the board configuration for the UART?

After you create your hexiwear board directory you will need to go through the file boards/hexiwear-k64f/include/periph_conf.h and check that especially the UART pins are correct for the debug UART. Also boards/hexiwear-k64f/include/board.h may have some pieces which need adjusting, the LED macros for example.

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.