Please, is there any one here that used portenta h7?
I need to read all the values in text file but I have no idea!! any HELP please?
Search the forum for related topics
Here is one
Thank you, now I can read and write from sdcard.
But now I am trying to run my code but I got on this error, Why? I have not any sleep function in my code!!
In file included from c:\users\lab\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\sys\reent.h:13:0,
from c:\users\lab\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\math.h:5,
from c:\users\lab\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\cmath:45,
from c:\users\lab\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\c++\7.2.1\math.h:36,
from C:\Users\lab\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\cores\arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/STM32H7xx_HAL_Driver/stm32h7xx_hal_def.h:33,
from C:\Users\lab\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\cores\arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/STM32H7xx_HAL_Driver/stm32h7xx_hal_rcc.h:29,
from C:\Users\lab\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\cores\arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/stm32h7xx_hal_conf.h:398,
from C:\Users\lab\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\cores\arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/STM32H7xx_HAL_Driver/stm32h7xx_hal.h:30,
from C:\Users\lab\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\cores\arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/STM32Cube_FW/CMSIS/stm32h7xx.h:223,
from C:\Users\lab\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\cores\arduino/mbed/targets/TARGET_STM/TARGET_STM32H7/cmsis.h:22,
from C:\Users\lab\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\cores\arduino/mbed/targets/TARGET_STM/PinNamesTypes.h:33,
from C:\Users\lab\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\variants\PORTENTA_H7_M7/pinmode_arduino.h:24,
from C:\Users\lab\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\cores\arduino/Arduino.h:26,
from sketch\portenta.ino.cpp:1:
c:\users\lab\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\sys\unistd.h:209:10: error: conflicting declaration of C function 'unsigned int sleep(unsigned int)'
unsigned _EXFUN(sleep, (unsigned int __seconds ));
^
In file included from C:\Users\lab\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\cores\arduino/mbed/drivers/include/drivers/HighResClock.h:22:0,
from C:\Users\lab\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\cores\arduino/mbed/mbed.h:82,
from C:\Users\lab\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\cores\arduino/mbed.h:8,
from C:\Users\lab\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\libraries\Portenta_SDCARD\src/SDMMCBlockDevice.h:21,
from C:\Users\lab\Desktop\portenta\portenta.ino:12:
C:\Users\lab\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\cores\arduino/mbed/platform/include/platform/mbed_power_mgmt.h:195:20: note: previous declaration 'void sleep()'
static inline void sleep(void)
^~~~~
exit status 1
Error compiling for board Arduino Portenta H7.
Sorry I have not done much with the SD (or anything else with the Portenta),
I did do some experimenting awhile ago as I mentioned in the thread:
Not sure if it will help or not.
Good luck
Thank you. Do you have any idea why I got this error? I have not any sleep function in my code(note: previous declaration 'void sleep()'
static inline void sleep(void)
^~~~~)
Sorry not sure: Again I don't use Portenta for much... Bought it, as was curious of the differences between it and the GIGA...
It is two different sets of include files, which both have declares for the sleep function.
The main one was included through the Arduino.h file, the other one was through the
Portenta library Portenta_SDCARD which included: SDMMCBlockDevice.h
Maybe problem with that library?
Note: I believe I was running my own library/example code that was displaying pictures off of an SD card (or USB drive), onto an ILI9341 display. Code is up at:
ILI9341_GIGA_n/examples/tft_picture_view_sd at main · KurtE/ILI9341_GIGA_n (github.com)
I have not run it in awhile, but did just successfully build the example:
The Example code included:
#ifdef ARDUINO_PORTENTA_H7_M7
#include "SDMMCBlockDevice.h"
#include "FATFileSystem.h"
#endif
The link shows:
C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\bootloaders\PORTENTA_H7\portentah7_bootloader_mbed_hs_v2.elf syntax error: no colon char on the first line character at line 1
Multiple libraries were found for "SdFat.h"
Used: C:\Users\kurte\Documents\Arduino\libraries\SdFat_real
Not used: C:\Users\kurte\Documents\Arduino\libraries\SdFat_-_Adafruit_Fork
Using library Arduino_USBHostMbed5 at version 0.3.1 in folder: D:\github\Arduino_USBHostMbed5
Using library SPI in folder: C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\libraries\SPI (legacy)
Using library Portenta_SDCARD at version 1.0 in folder: C:\Users\kurte\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\4.1.1\libraries\Portenta_SDCARD
Using library SdFat at version 2.2.2 in folder: C:\Users\kurte\Documents\Arduino\libraries\SdFat_real
Using library elapsedMillis at version 1.0.6 in folder: C:\Users\kurte\Documents\Arduino\libraries\elapsedMillis
Using library GIGA_digitalWriteFast in folder: D:\github\UNOR4-stuff\libraries\GIGA_digitalWriteFast (legacy)
Using library JPEGDEC at version 1.4.2 in folder: C:\Users\kurte\Documents\Arduino\libraries\JPEGDEC
Using library PNGdec at version 1.0.1 in folder: C:\Users\kurte\Documents\Arduino\libraries\PNGdec
Using library ILI9341_GIGA_n at version 1.1.1 in folder: D:\github\ILI9341_GIGA_n
Using library LibPrintf at version 1.2.13 in folder: C:\Users\kurte\Documents\Arduino\libraries\LibPrintf
My code is sort of convoluted, as I wrote wrapper class, such the other code could work with files returned by things like SDFat (for SPI connected SD cards)... Which run faster!
Hi @mercala_eng ,
You can check the example sketches available in Arduino IDE > Examples:
- PortentaSDCARD > TESTSDCARD: ArduinoCore-mbed/libraries/Portenta_SDCARD/examples/TestSDCARD/TestSDCARD.ino at main · arduino/ArduinoCore-mbed · GitHub
- Arduino_POSIXStorage > SD_Card_Example: Arduino_POSIXStorage/examples/SD_Card_Example/SD_Card_Example.ino at main · arduino-libraries/Arduino_POSIXStorage · GitHub
Best,
Thanks @Hm_pro. I have another question please, I working on code that deal with image make some processing on it when I run my code on teensy 4.1(memory= 1M) the max size of image that I can upload is uint8_t image[200][200]. The memory of portenta h7 is (2M) so why I can not use image size like [300][300] or [250][250] for the same code?
As I have mentioned earlier, I have done very little with the Portenta, a bit more with the GIGA. But have done lots with Teensy 4.x. I don't understand what you are saying here:
Note: lots more details about the memory on Teensy 4.x can be found at:
Teensy® 4.1 (pjrc.com)
Note sure what you mean by upload. Are you wanting your code to contain an image (like a bitmap), that you might use, for example display on a screen? With the Teensy 4.1 you have a flash size of: 8Mb Which can easily store a lot bigger image.
For example if you look at the example sketch: uncannyEyes_async_st7789... for the ST7735_t3 library that is installed with the Teensy installs, you will see several large images:
Look at the subdirectory of the example: graphics at the file default_large.h
The first image defined in this file starts off with:
#define SCLERA_WIDTH 375
#define SCLERA_HEIGHT 375
const uint16_t sclera[SCLERA_HEIGHT][SCLERA_WIDTH] PROGMEM = {
0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901,
0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901,
0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901,
0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901,
0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901, 0x6901,
There is a couple of things here that are important: const and PROGMEM. With these defined, the image is stored in flash (Actually everything is stored in flash), but the image is not copied down to RAM (DTCM area). Side effect is the access is slightly slower, but the hardware
cache helps with this.
Now if instead, you are asking about manipulating an image in memory and then save it away to SD card. I am currently playing with code for the Teensy (in this case the MicroMod) that can read in from a Camera a VGA image (640x480) and save it away to SDCard as a BMP file.
As for using the SD on the Portenta. My playing with it, found it REAL slow. Maybe slightly faster than use SPI... But in my earlier test I found:
If I remember correctly Bill (@fat16lib) sped up the SDFat library when you connect using SPI. At least at the time I was playing with it, I did not feel like he was going to put in support for the Portenta's SDIO. More details up at:
Not sure if that helps with your question or not?