bitbank2 / AnimatedGIF

An optimized GIF decoder suitable for microcontrollers and PCs
Apache License 2.0
359 stars 51 forks source link

STM32F401 #37

Closed jhonnyx161 closed 3 years ago

jhonnyx161 commented 3 years ago

Hello

You can make it work for STM32F401 and ST7789_NOCS

regards

bitbank2 commented 3 years ago

If you have enough memory, it should work on any CPU. Have you encountered a problem? What code have you tried?

jhonnyx161 commented 3 years ago

Hello Play_all_sd_files.ino file does not recognize SPI.begin (int, int, int, int); does not recognize SD.begin (int); Try with SPI.begin (); SD.begin (); , compiles but st7789_nocs flashes does not show images

Features STM32F401 STM32F401CEU6 Core board V3.0 Switching 84Mhz ROM: 64KB RAM: 256KB

https://es.aliexpress.com/item/4001049840288.html?spm=a2g0o.productlist.0.0.11a77e5bApFXJ6&aem_p4p_detail=20210616064357186051193167720007388639

lcd st7789_nocs https://es.aliexpress.com/item/32950879136.html?spm=a2g0o.productlist.0.0.1138310bcIEShv&aem_p4p_detail=20210616064842844622267999950007436758

Arduino IDE compiler (stm32duino) https://github.com/stm32duino regards

bitbank2 commented 3 years ago

I have all of that equipment - I'll give it a try and make any necessary changes to make it work.

bitbank2 commented 3 years ago

It compiles file without modifying anything. It sounds like you're having issues with SPI not configured correctly. Have you probed the MOSI and CLK lines to see if you've told it the correct pin numbers? I know that the software works, so I can't help with your particular setup. Do you have an SD card connected to your STM32? Have you tested that it reads the file successfully? There are too many parts to fail for me to help you. Why not try the demo code which draws a GIF file from memory first? That eliminates one of the unknowns in your setup.

tobozo commented 3 years ago

@jhonnyx161 you can eventually try this:


SPIClass *my_spi = new SPIClass(mosi, miso, sclk, ssel /* default= (uint8_t)NC */);
my_spi->begin( cs_pin );

// then later

SD.begin( sdcard_cs_pin, *my_spi );
jhonnyx161 commented 3 years ago

extract a GIF file from memory works play_all_sd_files.ino does not work returns the following error

play_all_sd_files: 158: 51: error: no matching function for call to 'SPIClass :: begin (int, int, int, int)' 158 | SPI.begin (SCK_PIN, MISO_PIN, MOSI_PIN, SD_CS_PIN); | ^ In file included from C: \ Users \ jhonn \ OneDrive \ Documents \ ArduinoSTM32 \ AnimatedGIF-master \ AnimatedGIF-master \ examples \ play_all_sd_files \ play_all_sd_files.ino: 3: C: \ Users \ jhonn \ AppData \ Local \ Arduino15 \ packages \ STM32 \ hardware \ stm32 \ 1.9.0 \ libraries \ SPI \ src / SPI.h: 154: 10: note: candidate: 'void SPIClass :: begin ( uint8_t) ' 154 | void begin (uint8_t _pin = CS_PIN_CONTROLLED_BY_USER); | ^ ~~~~ C: \ Users \ jhonn \ AppData \ Local \ Arduino15 \ packages \ STM32 \ hardware \ stm32 \ 1.9.0 \ libraries \ SPI \ src / SPI.h: 154: 10: note: candidate expects 1 argument, 4 provided exit status 1 no matching function for call to 'SPIClass :: begin (int, int, int, int)'

bitbank2 commented 3 years ago

There are multiple implementations of the SD library and I can't account for all of them in my example sketches. You'll have to solve this one yourself.