adafruit / Adafruit_MP3

mp3 decoding on arduino
39 stars 17 forks source link

STM32 F1x/F4x Support #2

Closed XFactHD closed 5 years ago

XFactHD commented 5 years ago

I am currently working on a project where I would love to use this library, however because of space, price and availability reasons it is not possible to use an Adafruit Feather/Metro M4 and if I am not mistaken, it is not possible to use a barebones ATSAMD51J19 chip without a very pricey programmer. In the context of another project I came across the STM32F1x lineup of MCUs and looking at the MCU boards supported by this library, specifically the Teensy 3.2, it seems to me that for example the STM32F103RE (72 MHz, Cortex M3, 64 KB RAM, 2 DACs) should be powerful enough to use this library on it. The STM32F4 foundation and advanced lineups (168-180 MHz, Cortex M4, 192-384 KB RAM, 2 DACs) may be a better choice in case the F103 is not or barely potent enough.

The biggest benefit I see in using an STM32F1x for this is that you can program it over UART without the need for a bootloader and therefore without the need for any other, possibly expensive hardware.

As I do not nearly have enough knowledge about this platform and low-level MCU programming in general, I am unable to judge wether my assumptions are correct and unable to port this library over.

If someone can give me advice on how to get a barebones ATSAMD51J19 to work without buying an expensive tool for a one time use, I would be very thankful as well.

ladyada commented 5 years ago

hiya we dont support any STM32 processesors but im sure there are other MP3 libraries that do! porting is nontrivial, if you're not sure if you can do it, its best to find an existing project.

for programming at atsamd51, you can use an ATMEL ICE, they're not too pricey.

XFactHD commented 5 years ago

Thank you for the quick response, I had already looked into ATMEL ICE devices but 100-150 € for a device I would rarely use is a bit much. I will definetly look into this a bit more but as it stands now, it is not really cost effective. If I use an ATMEL ICE, is it possible to always program the MCU directly through the programmer from the Arduino IDE similar to programming an 8-bit AVR over ISP or do I need to use another software to burn the bootloader and then upload the Arduino code via USB through the bootloader?

dhalbert commented 5 years ago

If this is not a commercial project you could also use a J-Link Edu Mini to program the SAMD51: https://www.adafruit.com/product/3571. It’s out of stock at our store right now but also available elsewhere.

XFactHD commented 5 years ago

I saw that one as well, can I use those programmers directly from the Arduino IDE or do I need to import the sketch into Atmel Studio 7 to upload it to the SAMD51?

I tried importing the play_from_SD example into Atmel Studio 7 yesterday but I can't get it to work because the Metro/Feather/ItsyBitsy M4 board definitions have "cortex-m4" in the device selection menu when importing an Arduino sketch instead of a specific MCU.