Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenCR Board Support (STM32F746ZGT6) #140

Open
airhorns opened this issue Jul 30, 2018 · 11 comments
Open

OpenCR Board Support (STM32F746ZGT6) #140

airhorns opened this issue Jul 30, 2018 · 11 comments
Labels

Comments

@airhorns
Copy link

It'd be awesome to be able to work on OpenCR robotics projects with PlatformIO instead of the Arduino IDE. OpenCR is an awesome project: it has a wide variety of inputs and outputs, Arduino UNO compatible pinouts for shields, integrated power management for input of 5-24V with shore power / battery uninterrupted support, and really isn't too much money. It's the board that does the real time stuff for Turtlebot3 if you are familiar with it.

ROBOTIS has already done a bunch of work to get a toolchain in place for loading code onto the thing, so I hope that it's just a case of configuring PlatformIO to know what to put where!

The documentation for the board can be found here: http://emanual.robotis.com/docs/en/parts/controller/opencr10/

And the manifest for the Arduino IDE Board Manager can be found here: https://raw.githubusercontent.com/ROBOTIS-GIT/OpenCR/master/arduino/opencr_release/package_opencr_index.json

and the code for the existing OpenCR TurtleBot3 firmware can be found here: https://github.com/ROBOTIS-GIT/opencr

@ivankravets
Copy link
Member

Could you try this board manifest https://github.com/platformio/platform-ststm32/blob/develop/boards/nucleo_f746zg.json
Does it work?

@marcosjl
Copy link

Hi !
I jump in as I have tried to use the nucleo_f746zg manifest... Did not succeeded : cross compilation works fine, but I'm just enable to upload the code to the openCR board...
Jose

@marcosjl
Copy link

Arduino framework provided by Robotis uses a specific bootloader as in platformio, boot loader defined for STM32 boards seems to be openCD.
Is there a description of what needs to be done to define a specific board / bootloader in the doc ? I've found this : https://docs.platformio.org/en/latest/platforms/custom_platform_and_board.html, but I did not manage to have something up & running...
Thanks in advance

@valeros
Copy link
Member

valeros commented Oct 23, 2019

Hi @marcosjl ! What upload method are you using? Looks like the first 0x40000 bytes are reserved for bootloader. You could try to specify this offset in platformio.ini:

[env:nucleo_f746zg]
platform = ststm32
board = nucleo_f746zg
framework = arduino
board_upload.offset_address=0x08040000

@marcosjl
Copy link

Hi @valeros !
Nope it does not work either.

Trying to compile a basic empty program (no code lines in the mbed template for main.cpp).

I get this error messages on the upload stage :

`Configuring upload protocol...
AVAILABLE: blackmagic, jlink, mbed, stlink
CURRENT: upload_protocol = stlink
Uploading .pio\build\nucleo_f756zg\firmware.bin
xPack OpenOCD, 64-bit Open On-Chip Debugger 0.10.0+dev (2019-07-17-11:28)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

srst_only separate srst_nogate srst_open_drain connect_deassert_srst

Error: open failed
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked

*** [upload] Error 1
`

@valeros
Copy link
Member

valeros commented Oct 30, 2019

@marcosjl What is your debug probe? You selected stlink, but OpenOCD doesn't recognize it.

@marcosjl
Copy link

Honestly @valeros... I'm completely lost.

OpenCR framework in arduino 1.8.x uses its own boot loader called opencr_ld. My intention was to create a custom board using arduino stm32 package.
But I must confess that either i'm a too silly, or the documentation is to "high level" for my undestanding... (or both ? ;) )

I've been googling to find some kind of tutorial "Add a custom board in platformIO" for dummies but I did not found something relevant so far...

Documentation is too synthetic IMHO, specialy for dummies like me. :)

@valeros
Copy link
Member

valeros commented Oct 31, 2019

@marcosjl You say the board has a custom bootloader, so probably there is a custom upload tool used for uploading code, so the question is how do you plan to upload firmware to the board?

@cguimaraes
Copy link

The previous PR (#597) provides the required support for OpenCR in PlatformIO.
However, it is also required to include the following core files as a new package:
https://github.com/cguimaraes/framework-arduinoststm32-opencr

@valeros: any advice on how to make piopm aware of it and automatically fetch it?
So far I have to install it manually, as we described in the bottom of this blog post: https://zenoh.io/blog/2022-02-08-dragonbot/

@concavegit
Copy link

Thanks for sharing the package, it works for me and I am glad I can use IDEs suited for larger projects now. For anyone else following the blog post, I also needed to add

upload_command = ${platformio.packages_dir}/framework-arduinoststm32-opencr/tools/linux/opencr_ld /dev/ttyACM* 115200 $SOURCE 1

to my platform.ini to upload to my OpenCR board.

@cguimaraes
Copy link

Great that it worked without issues and that it is being useful @concavegit .
And thank you for providing the upload command, as I forgot to indicate it in the steps above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants