STM32DUINO - Architecture questions

Post here first, or if you can't find a relevant section!
User avatar
GrumpyOldPizza
Posts: 170
Joined: Fri Apr 15, 2016 4:15 pm
Location: Denver, CO

Re: STM32DUINO - Architecture questions

Postby GrumpyOldPizza » Wed Feb 01, 2017 12:25 pm

racemaniac wrote:As we're talking architecture: i would love to see some more attention to offering some async DMA libraries :). that's where the true IO power of these little guys is, and by sticking to the arduino API we're completely missing it >_<.

Also for many of the reasons mentioned in this thread, i'm currently working in visual studio with visualgdb & the cubemx code generator. i got great debugging, can create code for any stm32, far better IDE, ...
But i'm very grateful this arduino port a IDE exists for doing the simple stuff, and it was also what allowed me to get started with all of this withouth a huge learning curve upfront :).


The STM32L4 core went this route with async DMA libraries, like Wire.transfer(uint8_t address, const uint8_t *txBuffer, size_t txSize, uint8_t *rxBuffer, size_t rxSize, bool stopBit, void(*callback)(uint8_t)); Consistently added to Uart/SPI/Wire. So you can have both, the simpler parts of classic Arduino and the added power of async io operations.

Some folks I know use "Visual Micro" which integrates openocd/gdb. So debugging should be possible there as well. Haven't tried it myself though, I'm a Unix guy ...

Ollie
Posts: 137
Joined: Thu Feb 25, 2016 7:27 pm

Re: STM32DUINO - Architecture questions

Postby Ollie » Wed Feb 01, 2017 5:09 pm

stevestrong wrote:
Ollie wrote:The applications cannot be ported between these two IDEs due to different libraries.

@Ollie, could you be a bit more specific? You mean that the INO sketch for Arduino IDE cannot be compiled with EmBitz? Not even if one rename the *".ino" to "*.cpp"?


@stevestrong, if the INO sketch uses any arduino specific header files, such as the hidden Arduino.h, then those are not found in EmBitz environment. Same is true for the leaflabs libraries. For STMF103, it is feasible to change all the library calls with similar STM SPL calls used by default in EmBitz.

The other alternative is to install the arduino or leaflab libraries in EmBitz, but I guess that there are several practical problems in this. I have done imports from MBED into EmBitz and this has worked very well. In that case the imported MBED libraries are used instead of SPL.

There are no practical problems in porting your own libraries between Arduino and EmBitz in case those libraries are written in C or C++ and are not using any native libraries.

A cheap (around $3) J-link module is recommended for EmBitz development.

Ollie
Posts: 137
Joined: Thu Feb 25, 2016 7:27 pm

Re: STM32DUINO - Architecture questions

Postby Ollie » Wed Feb 01, 2017 5:11 pm

GrumpyOldPizza wrote:Some folks I know use "Visual Micro" which integrates openocd/gdb. So debugging should be possible there as well. Haven't tried it myself though, I'm a Unix guy ...


I had some sad experiences with Visual Micro. I id use it on several development machines and the Visual Studio underneath Visual Micro got messed up. I didn't find any way to repeat the installation to get the system to work again.

willfly1
Posts: 17
Joined: Wed Jan 04, 2017 5:13 pm
Location: GTA, Canada

Re: STM32DUINO - Architecture questions

Postby willfly1 » Sat Feb 04, 2017 3:58 pm

Sorry for late reply - here is how I build using Npp. Essentially it invokes arduino_debug.exe and pass in command line parameters just like compiling a Java program etc.

1. Install NppExec plugin
2. Add following commands:
Compile Sketch

Code: Select all

//save current file
NPP_SAVE
cd "$(CURRENT_DIRECTORY)"
"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref build.path="$(CURRENT_DIRECTORY)/build" --verify "$(FULL_CURRENT_PATH)"


Upload Sketch

Code: Select all

//save current file
NPP_SAVE
cd "$(CURRENT_DIRECTORY)"
"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref build.path="$(CURRENT_DIRECTORY)/build" --upload "$(FULL_CURRENT_PATH)"


3. In NppExec advanced options, opt to place commands in Macros Submenu
4. Optional: Attach hotkeys to these macros in Npp to invoke Compile or Upload

I don't remember changing the console output filters (Highlight Masks), but here they are:

Code: Select all

%FILE%:%LINE%: warning:*
%FILE%:%LINE%: error:*
Low memory available*
Sketch too big*
*#pragma message*
%FILE%:%LINE%: fatal error:*


Double click on error or warning message will jump to relevant section in code.

In this particular setup the config parameters (targets/memory/board etc) are changed from Arduino IDE (changes persist when IDE exits). There is an option to pass in those through command line as well.

User avatar
BennehBoy
Posts: 413
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: STM32DUINO - Architecture questions

Postby BennehBoy » Sat Feb 04, 2017 5:31 pm

Brilliant, thanks, got it working.

Need to figure out how to switch the IDE between target device types now though :D
-------------------------------------
https://github.com/BennehBoy

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32DUINO - Architecture questions

Postby RogerClark » Sat Feb 04, 2017 8:04 pm

BennehBoy wrote:Brilliant, thanks, got it working.

Need to figure out how to switch the IDE between target device types now though :D


Probably overkill, but there is a scripable automation system for Windows called AutoIt, which you could use to change menu options in the IDE, and could run those scripts from NPP.

User avatar
sheepdoll
Posts: 225
Joined: Fri May 22, 2015 12:58 am
Location: Silicon Valley Vortex
Contact:

Re: STM32DUINO - Architecture questions

Postby sheepdoll » Sat Feb 04, 2017 8:08 pm

I just posted my makefile script in this thread http://stm32duino.com/viewtopic.php?f=42&t=337&start=10#p23322

User avatar
BennehBoy
Posts: 413
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: STM32DUINO - Architecture questions

Postby BennehBoy » Sat Feb 04, 2017 9:04 pm

RogerClark wrote:Probably overkill, but there is a scripable automation system for Windows called AutoIt, which you could use to change menu options in the IDE, and could run those scripts from NPP.


No Need, Just define some new menu items:

Code: Select all

Maple Mini
"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref board="mapleMini" --pref custom_upload_method="genericSTM32F103C_serialMethod" --pref target_package="Arduino_STM32-master" --pref target_platform="STM32F1" --pref custom_bootloader_version="mapleMini_original"

Maple Mini BL2
"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref board="mapleMini" --pref custom_upload_method="genericSTM32F103C_serialMethod" --pref target_package="Arduino_STM32-master" --pref target_platform="STM32F1" --pref custom_bootloader_version="mapleMini_bootloader20"

Nano
"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref board="nano" --pref target_package="arduino" --pref target_platform="avr"


On Windows I got the config items from:
C:\Users\Yourusername\AppData\Local\Arduino15\preferences.txt

The IDE saves this on each exit.
-------------------------------------
https://github.com/BennehBoy

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: STM32DUINO - Architecture questions

Postby RogerClark » Sat Feb 04, 2017 9:09 pm

BennehBoy wrote:
RogerClark wrote:Probably overkill, but there is a scripable automation system for Windows called AutoIt, which you could use to change menu options in the IDE, and could run those scripts from NPP.


No Need, Just define some new menu items:

Code: Select all

Maple Mini
"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref board="mapleMini" --pref custom_upload_method="genericSTM32F103C_serialMethod" --pref target_package="Arduino_STM32-master" --pref target_platform="STM32F1" --pref custom_bootloader_version="mapleMini_original"

Maple Mini BL2
"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref board="mapleMini" --pref custom_upload_method="genericSTM32F103C_serialMethod" --pref target_package="Arduino_STM32-master" --pref target_platform="STM32F1" --pref custom_bootloader_version="mapleMini_bootloader20"

Nano
"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref board="nano" --pref target_package="arduino" --pref target_platform="avr"


On Windows I got the config items from:
C:\Users\Yourusername\AppData\Local\Arduino15\preferences.txt

The IDE saves this on each exit.


Thats interesting... Thanks for sharing.

BTW.

Is anyone using any of the C tools for NPP that allow you to look up where a function is defined and view it etc.

I did briefly look into this, ( i forget what it was called), but when I went to install the plugin. there was a security warning, so I decided not to install.

User avatar
BennehBoy
Posts: 413
Joined: Thu Jan 05, 2017 8:21 pm
Location: Yorkshire
Contact:

Re: STM32DUINO - Architecture questions

Postby BennehBoy » Sat Feb 04, 2017 9:16 pm

And com port setting:

Code: Select all

"c:\Program Files (x86)\Arduino\arduino_debug.exe" --pref serial.port="COM9" --pref serial.port.file="COM9"
-------------------------------------
https://github.com/BennehBoy


Return to “General discussion”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests