mylonics / zephyr-ide

Apache License 2.0
16 stars 2 forks source link

Custom flash loader for "teensy" #12

Closed black-ghost-off closed 1 month ago

black-ghost-off commented 1 month ago

https://github.com/mylonics/zephyr-ide/issues/11 The build is going well. However, the problem now is that I can't add a runner for flash teensy (there is a custom bootloader without swd/jtag and it is necessary only through their utility ( https://www.pjrc.com/teensy/loader_cli.html )

rijesha commented 1 month ago

You can make a custom task and run the task via vscode.


{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  "version": "2.0.0",
  "tasks": [
    {
      "label": "flash_teensy",
      "type": "shell",
      "command": "teensy_loader_cli --mcu=mk20dx256 -w ${command:zephyr-ide.get-active-build-path}/zephyr/zephyr.hex"
    }
  ]
}
``` `

At the moment there is no way to rebind the GUI's flash button with a custom task.
So you will need to call this directly from vscode. (ctrl-p > Tasks: Run Task > flash_teensy)
You can also make a keyboard shortcut for it via vscode.
black-ghost-off commented 1 month ago

I know. However, zephyr natively supports teensy_cli (you need to specify the path of the utility), I mean it should work in our case out of the box)

Offtop: I have already tested xiao seeed ble(nrf52840), nucleo h563zi, nrf52840 devkit, everything works fine with the IDE Now in progress testing xiao seeed ESP32s3, esp32s3 devkit n8r8

rijesha commented 1 month ago

could you give me the west command you would run to load the code.

black-ghost-off commented 1 month ago

Just

west flash image

black-ghost-off commented 1 month ago

path "teensy_loader_cli.exe" in added to PATH

rijesha commented 1 month ago

I pushed an update (1.0.15) that allows the default west flash to be run for this board. You will have to pass the runner arguments when you setup the runner. ("-H -r teensy")

black-ghost-off commented 1 month ago

image image image

If built with https://docs.zephyrproject.org/latest/develop/getting_started/index.html But the project that is created by the IDE does not lend itself to

west flash --build-dir “.\build\teensy40\”

rijesha commented 1 month ago

What is the build command that you use?

The error is correct and the teensy folder does not have a board.cmake file I think that is why there is no zephyr_runners_yaml

rijesha commented 1 month ago

What version of zephyr did you use for the build that works and what version are you using with zephyr-ide?

rijesha commented 1 month ago

Ok. I think the problem is that you are using the v3.6.0 release of zephyr. That version doesn't have support for the teensy cli flasher.

Change the revision in application/west.yml file from v3.6.0 to main and then run a west update.

rijesha commented 1 month ago

You will also need to remake the build configurations, because main has the board directories reorganized.

IOT4566 commented 1 month ago

Zephyr ide retrieves the supported runners for this board by traversing board.cmake file in the board directory, but unfortunately, teensy4 does not include board.cmake, while other boards do

IOT4566 commented 1 month ago

Zephyrproject requirements theboard.cmake file must have

black-ghost-off commented 1 month ago

I change 3.6.0 to main, and that fix problem well. For feature add option for select version of zephyr?

rijesha commented 1 month ago

The west init function should now have that ability.