Spark Logic

Firmata

jonathanberi Sat Aug 01, 2015 7:56 pm

I wanted to port Firmata to STM32 boards and figured STM32duino would be the easiest path. I was able to upload a blinking programming via stlink on a nucleoF401RE board. I actually don’t need help ATM (though help is always welcome!) but posted here since there isn’t a “in progress” section. You can follow along at https://github.com/beriberikix/Arduino_STM32.

Replies

martinayotte Wed Aug 12, 2015 12:36 am

jonathanberi wrote:w00t, progress! After a git pull EchoPing now compiles without error. I don’t have the board handy ATM the moment but will test it when I get home.

Now when I start trying out the different builds variations of Firmata (with different features,) I get all different, albeit useful, errors.

[…]

Looking at the F4 core, I don’t see Wire (only wirish) and I don’t see Servo in libraries. Copying Servo from the F1 directory allows ServoFirmata to compile but I’m not sure what do with the Wire issues on the other files like StandardFirmata.

RogerClark Wed Aug 12, 2015 12:53 am

(@Roger, should we have library folder for all common libs between F1/F2/F3/F4 ?)

I don’t think its possible for the Arduino IDE to look elsewhere apart from /CORE/libraries

So I can’t see how we can put the lib’s elsewhere

aramperez Tue Nov 08, 2016 1:00 pm

Has any further work been done on getting Firmata running with an STM32 board? I’d like to run Firmata on a Chinese Maple Mini clone.

Thanks,
Aram

aramperez Sun Dec 04, 2016 1:16 pm

Hi fpiSTM,

Sorry, I’m new to how the Arduino IDE internal structure works and how “Arduino for STM32” modifies that structure. From a quick glance at the links, it appears that the changes are against something other than “Arduino for STM32”. So how would I add those changes to “Arduino for STM32”?

Thanks,
Aram

fpiSTM Mon Dec 05, 2016 9:28 am

Hi Aram,

I don’t think you should use the repo STM from my github.
You should keep the one from stm32duino.
I only give you an example how the firmata library has been updated.
I think you should copy the firmata library to the hardware/xxxx/libraries/ and customize it or modify the one to the libraries/ it as it has been done for the STM32F103.
Just think to use a switch related to the maple mini in the header:
#elif defined(STM32) <– STM32 to update

aramperez Mon Dec 05, 2016 12:57 pm

Hi Frederick,

fpiSTM wrote:I don’t think you should use the repo STM from my github. You should keep the one from stm32duino.

fpiSTM Mon Dec 05, 2016 1:41 pm

Which one from stm32duino? If I search https://github.com/rogerclarkmelbourne/Arduino_STM32, I do not find anything related to Firmata.

Yes this one, I think. As it mentions “including LeafLabs Maple, and Maple mini”.
For the library, I don’t know it, I provided you only an example on how it has been adapted for the STM32F103. If it request more update, you will have to do it.
I do not know the maple part, maybe @RogerClark could help/advise.

RogerClark Mon Dec 05, 2016 7:46 pm

Aram

You seem to somehow have a mix of both the Libmaple based core and STMs new core.

Did you install from both the boards manager package and download the zip file from my repo.

aramperez Mon Dec 05, 2016 9:05 pm

Hi Roger,

RogerClark wrote:You seem to somehow have a mix of both the Libmaple based core and STMs new core.
Did you install from both the boards manager package and download the zip file from my repo.

RogerClark Mon Dec 05, 2016 9:49 pm

The LibMaple version can be installed via boards manager, as @ddrown has done this on his site.

However generation of the boards manager package files is not straight forward and I don’t personally have time to do this

With the STM official version, we added a WIP branch which adds support for the Maple mini and Blue Pill, but as it is not official there is not a Boards Manager for this either.

RogerClark Mon Dec 05, 2016 9:57 pm

aramperez wrote:
…..

However, the Maple Mini code uses Libmaple and it’s Wire implementation hasn’t been updated to the latest Arduino Wire API, it is missing an endTransmission(argument) method [I believe that ‘argument’ is a bool but I haven’t dug into the code yet].
.

aramperez Mon Dec 05, 2016 11:53 pm

RogerClark wrote:
If you can tell me what the new function does, perhaps we can include it

BTW. I took a look at the Arduino Wire code and it has this extra code

if (stopBit)
{
sercom->prepareCommandBitsWire(WIRE_MASTER_ACT_STOP);
}

RogerClark Tue Dec 06, 2016 12:36 am

OK

I suspect we can perhaps do this simply by not calling i2c_stop()

I’m not precisely sure why the Arduino team wrote another version of the function, rather than just changing the existing function to include a parameter and then default that parameter to true.

aramperez Tue Dec 06, 2016 2:41 am

Or why not use a ‘bool’ as the argument type instead of an ‘uint8_t’.

Thanks,
Aram

RogerClark Tue Dec 06, 2016 3:19 am

Our endTransmission does not have an argument, its current (void)

Sign in to reply