Git Product home page Git Product logo

arduinocore-mbed's Introduction

Arduino Core for mbed enabled devices

The repository contains the Arduino APIs and IDE integration files targeting a generic mbed-enabled board

FAQ

Source-Code Level Debugging

Question: "I want to debug my ArduinoCore-mbed based sketch using traditional debugging tools, i.e. gdb via SWD interface. However, the debugger is unable to locate the sources for all files, particular the mbed-os files."

Answer: This is due to the fact that we pre-compile the mbed-os code into a static library libmbed.a. Information on how to recompile libmbed.a for source code debugging can be found here. The Arduino Documentation also contains articles explaining how to debug via Segger J-Link and Lauterbach TRACE32.

Installation

Note:

Clone the repository in $sketchbook/hardware/arduino-git

mkdir -p $sketchbook/hardware/arduino-git
cd $sketchbook/hardware/arduino-git
git clone [email protected]:arduino/ArduinoCore-mbed mbed

Clone https://github.com/arduino/ArduinoCore-API into a directory of your choice.

git clone [email protected]:arduino/ArduinoCore-API

Update the api symlink

Create a symlink to ArduinoCore-API/api in $sketchbook/hardware/arduino-git/mbed/cores/arduino.

Test things out

Open the Arduino IDE.

You should now see three new targets under the MBED boards label.

This procedure does not automatically install the required ARM compiler toolchain.

If the toolchain is missing, you'll see errors like this when you try to build for an mbed-os enabled board.:

fork/exec /bin/arm-none-eabi-g++: no such file or directory

To install ARM build tools, use the Boards Manager option in the Arduino IDE to add the Arduino mbed-enabled Boards package.

mbed-os-to-arduino script

The backbone of the packaging process is the https://github.com/arduino/ArduinoCore-mbed/blob/master/mbed-os-to-arduino script. It basically compiles a blank Mbed OS project for any supported target board, recovering the files that will be needed at compile time and copying them to the right location. This script is compatible only with Linux. If you are using macOS, use the https://github.com/arduino/ArduinoCore-mbed/blob/master/mbed-os-to-arduino-macos script.

It can be used for a variety of tasks including:

Recompiling libmbed with source level debug support

cd $sketchbook/hardware/arduino-git/mbed
./mbed-os-to-arduino -a -g PORTENTA_H7_M7:PORTENTA_H7_M7

In this case -a applies all the patches from patches folder into a mainline mbed-os tree, and -g restores the debug info.

Selecting a different optimization profile

cd $sketchbook/hardware/arduino-git/mbed
PROFILE=release ./mbed-os-to-arduino -a NANO_RP2040_CONNECT:NANO_RP2040_CONNECT

The PROFILE environment variable tunes the compilation profiles (defaults to DEVELOP). Other available profiles are DEBUG and RELEASE.

Selecting a different Mbed OS tree

cd $sketchbook/hardware/arduino-git/mbed
./mbed-os-to-arduino -r /path/to/my/mbed-os-fork NICLA_VISION:NICLA_VISION

-r flag allows using a custom mbed-os fork in place of the mainline one; useful during new target development.

Adding a new target (core variant)

Adding a target is a mostly automatic procedure.

For boards already supported by Mbed OS, the bare minimum is:

cd $sketchbook/hardware/arduino-git/mbed
mkdir -p variants/$ALREADY_SUPPORTED_BOARD_NAME/{libs,conf}
./mbed-os-to-arduino $ALREADY_SUPPORTED_BOARD_NAME:$ALREADY_SUPPORTED_BOARD_NAME
# for example, to create a core for LPC546XX
# mkdir -p variants/LPC546XX/{libs,conf}
# ./mbed-os-to-arduino LPC546XX:LPC546XX

This will produce almost all the files needed. To complete the port, add the board specifications to boards.txt (giving it a unique ID) and provide pins_arduino.h and variants.cpp in variants/$ALREADY_SUPPORTED_BOARD_NAME folder. Feel free to take inspirations from the existing variants :)

For boards not supported by mainline Mbed OS, the same applies but you should provide the path of your Mbed OS fork

cd $sketchbook/hardware/arduino-git/mbed
mkdir -p variants/$BRAND_NEW_BOARD_NAME/{libs,conf}
./mbed-os-to-arduino -r /path/to/mbed-os/fork/that/supports/new/board $BRAND_NEW_BOARD_NAME:$BRAND_NEW_BOARD_NAME

Customizing Mbed OS build without modifying the code

Most Mbed OS defines can be tuned using a project file called mbed_app.json . In case you need to tune a build you can add that file to your variant's conf folder. One example is https://github.com/arduino/ArduinoCore-mbed/blob/master/variants/PORTENTA_H7_M7/conf/mbed_app.json . Providing an invalid json or replacing a non-existing property will make the build fail silently, so it's always better to validate that file with a standard Mbed OS project.

Using this core as an mbed library

You can use this core as a standard mbed library; all APIs are under arduino namespace (so they must be called like arduino::digitalWrite() )

The opposite is working as well; from any sketch you can call mbed APIs by prepending mbed:: namespace.

arduinocore-mbed's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

arduinocore-mbed's Issues

Request: Pin Remapping For MKR I/O's To Use Alternate Pin Functions

Hello All,

The STM32H747XIH6 has many different alternate functions for the pins that have been assigned to the MKR I/O interface.

Maybe initially the most useful (lib) could be just using some pins as GPIO's that have been assigned to another function, such as
SPI2 (i.e., M3, M4). Of course, some pins are GPIO_Analog inputs only (i.e., R1 and R2 pin type AN A) - but this can be useful even using the Portenta carrier. The H7 processor is so feature rich that I think building a capability like this in the foundation of the Portenta project makes a lot of sense. Maybe somethings already available that I've missed - but I just wanted to float this out there and see what the responses are.

There are certainly a lot of available libraries available for some of the other boards which manipulate GPIO pins.

I guess the starting point would be to look at some of the lower level files that set up the pins and see if all possible GPIO functions have been mapped - and if not - enable that - then a lib that is compatible with the arduino tool chain would have to be developed - maybe this has been done already.

If this already exists - I'd like to give it a try and please point me to the lib if so.

For the GPIO's - will pinMode() override that if in the lower level code that's not enabled (GPIO mode, that is)?
And, pinPeripheral() isn't defined or available yet, correct?
(#28 Added WIP)

Thanks In Advance,
John W.
Reference:
Pin mapping files:
PeripheralPins.c
PeripheralNames.h
PinNames.h
system_clock_override.c

arm_math.h functions not included in core

@facchinm we have the following code which compiles fine against the nRF52 core (Arduino nRF528x Boards (Mbed OS) v1.1.4), but not against Portenta H7 (M7 core) (Arduino mbed-enabled Boards v1.2.0). I think the CMSIS-DSP functions are not compiled into this core...

#include <Arduino.h>
#include "arm_math.h"

void setup() {
   float v1[] = { 3.21f, 1.27f };
   float v2[] = { 8.21f, 3.33f };
   float dest[2];
   arm_add_f32(v1, v2, dest, 2);
   Serial.print(dest[0]);
   Serial.print(dest[1]);
   Serial.println();
}

void loop() {
  
}

This fails when linking with:

/var/folders/3r/fds0qzv914ng4t17nhh5xs5c0000gn/T/arduino_build_436493/sketch/asdhjasdhjqwfd2.ino.cpp.o: In function `setup':
/Users/janjongboom/Documents/Arduino/libraries/ei-continuous-gestures-arduino-1.0.10/examples/asdhjasdhjqwfd2/asdhjasdhjqwfd2.ino:30: undefined reference to `arm_add_f32'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Portenta H7 (M7 core).

Portenta AP: Evidently, simultaneous AP connection and queued web browser cause reset

To repeat: (built with latest master branch in this repository)

Have a web browser with automatic reconnect/refresh pointing to the AP's IP; e.g. - 10.0.0.1; if

WiFi.config(IPAddress(10, 0, 0, 1));

was used in the Portanta AP demo/tutorial example: AP Tutorial

Symptoms:

Usually, the first time through the demo - it'll work fine.

  1. Portenta is either reset or reprogrammed - usually the latter.
  2. Web page that was pointing to 10.0.0.1 is left open - i.e. - the page in firefox/mozilla is left pointing to http://10.0.0.1
  3. When reconnecting to the Portenta's AP - the Porenta will reset. On a few occasions I've seen the Portenta to be unresponsive and has to be manually reset/ power cycled.

Using the same code as posted here: 42

Thanks And Regards.
John W.

FYI: MKR-RGB Shield Working With Portenta H7 - (A3->A5 Jumper Required)

Hello All,

Just an FYI - to circle back to this:

The PR for the MRK-RGB Shield is here:

And - in the meantime - you can clone this: and run your MKR-RGB shield on the H7. Just one jumper required and just uncomment:

#define USING_PORTENTA_H7
in MKRRGBMatrix.h

I've only currently tested using the 5x7 font thus far.

If anyone's curious I made use of the shiftOut() function to make this work.

Best Regards,
John W.

Problem with arm_math.h functions not included in core

soulkrown:~/Library/Arduino15/packages/arduino-beta/hardware/mbed/1.2.0/cores $ find . -name "arm_math.h"
./arduino/mbed/cmsis/TARGET_CORTEX_M/arm_math.h

I have this problem when I compile with Mbed OS but not with nRF528x Mbed OS

"error: 'F' was not declared in this scope" after using #include "mbed.h"

Hello,
I am porting the IRMP library to Arduino Nano 33 BLE, but get errors.
The minimal program reproducing it is:

// minimal error demo
#include <Arduino.h>
#include "mbed.h"
//#define F(a) a // This definition fixes the error: "error: 'F' was not declared in this scope"
mbed::Ticker sMbedTimer; // not use in minimal error demo

void setup() {
    Serial.begin(115200);
    // Just to know which program is running on my Arduino
    Serial.println(F("START " __FILE__ " from " __DATE__));
}

void loop(){
}

As documented, commenting out line 4 fixes it.
I saw, you introduced the behavior with this commit, but I do not know the background.

Can you add the fix #define F(a) a to mbed.h???

Thanks
Armin

Improve console messages while flashing M4 / M7

Two suggestions to improve the console messages when flashing the M4 or M7.

  1. The action in the IDE for flashing a board is called "Upload". Hence the success message in the editor window is "Done uploading." Meanwhile the output in the console is "Download done. File downloaded successfully". While technically reasonable I'd suggest to make this consistent.
  2. It has been reported by @hpssjellis that accidentally uploading to the wrong core can easily happen every now and then. We might improve the situation a bit by including the core in the upload / download message. E.g. "File uploaded successfully to M7".

@facchinm thoughts?

ThreadDebug Lib - Unresponsive After Start

Hello All,

Originally discussed here: https://github.com/arduino/ArduinoCore-mbed/issues/16

I've tried using the ThreadDebug Library with the Portanta_M7 - at the top of my sketch:

#include <ThreadDebug.h>

// UartDebugCommInterface debugComm(SERIAL1_TX, SERIAL1_RX, 230400);
// ThreadDebug threadDebug(&debugComm, DEBUG_BREAK_IN_SETUP);

UsbDebugCommInterface debugComm(&SerialUSB);
ThreadDebug threadDebug(&debugComm, DEBUG_BREAK_IN_SETUP);


The debug console window prints:
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from c:/temp/Display/Display.arduinobeta.mbed.envie_m7.elf...
done.
GDB unhandled notify: cmd-param-changed: {"param":"pagination","value":"off"}
GDB unhandled notify: cmd-param-changed: {"param":"target-charset","value":"ASCII"}
Remote debugging using COM4

If I type show configuration it says:
Please start a debug session to evaluate - but a debug session is running.


Another session where it just disconnects after starting:
.
Find the GDB manual and other documentation resources online at:
.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from c:/temp/Display/Display.arduinobeta.mbed.envie_m7.elf...
done.
GDB unhandled notify: cmd-param-changed: {"param":"pagination","value":"off"}
GDB unhandled notify: cmd-param-changed: {"param":"target-charset","value":"ASCII"}
Remote debugging using COM4
setup () at c:\temp\Display/Display.ino:214
214 {
Will reset on next continue.
Note: automatically using hardware breakpoints for read-only addresses.
Remote connection closed

So, any help appreciated.

Thanks,
John W.
debug

WiFiUDP Doesn't Compile

To reproduce, just instantiate an instance:

WiFiUDP Udp;

....ino:145:9: error: cannot declare variable 'Udp' to be of abstract type 'arduino::WiFiUDP'
WiFiUDP Udp;
^~~
In file included from C:...\AppData\Local\Arduino15\packages\arduinobeta\hardware\mbed\1.2.1\libraries\WiFi\src/WiFi.h:32:0,

I see there's a pull request posted as well.

Thanks,
John W.

New ThreadDebug Commit - g++ not found in %PATH%

Hello All (Martino),

Trying your latest commit with the ThreadDebug lib - getting this:

new-threadlib-commit

Compilation error: Error: 2 UNKNOWN: exec: "g++": executable file not find in %PATH%.

Probably an easy one to fix - just wanted to report it - I'll see if I can do a workaround since I really want to see this run.

Compiling...
{
"sketchUri": "file:///c%3A/tmp/demo-web-server/demo-web-server.ino",
"fqbn": "arduinobeta:mbed:envie_m7_thread_debug", <=== is that a possible reason?
"optimizeForDebug": true
}

Also seeing:
Error during Debug: Cannot get command line for tool: cannot get programmer tool: undefined 'debug.tool' property

It does appear to be running from the command line:
C:\tmp\demo-web-server\build\arduinobeta.mbed.envie_m7>C:\Users\John\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\bin\arm-none-eabi-gdb -ex "set pagination off" --baud 230400 -ex "set target-charset ASCII" -ex "set print pretty on" -ex "set remotelogfile mri.log" -ex "target remote COM4" demo-web-server.ino.elf
GNU gdb (GNU Tools for Arm Embedded Processors 7-2017-q4-major) 8.0.50.20171128-git
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-w64-mingw32 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from demo-web-server.ino.elf...done.
Remote debugging using COM4
setup () at c:\tmp\demo-web-server/demo-web-server.ino:28
28 void setup() {
(gdb) finish
Run till exit from #0 setup () at c:\tmp\demo-web-server/demo-web-server.ino:28
Note: automatically using hardware breakpoints for read-only addresses.
[New Thread 604075640]
[New Thread 604081468]
main () at C:\Users\john\AppData\Local\Arduino15\packages\arduinobeta\hardware\mbed\1.2.2\cores\arduino\main.cpp:47
47 loop();

Also - in ThreadDebug 'mode' - two identical COM ports are listed:

two-portenta-com-ports-thread-debug-mode

Thanks!
John W.

Portenta H7 Bootloader

Hello All,

I've looked everywhere on my drive - I can't find any tools/scripts regarding the bootloader other than what is in platform.txt -
(openocd, etc, are there under ./arduino/..)

Uploader tools

---------------------

tools.openocd.path={runtime.tools.openocd-0.10.0-arduino13.path}
tools.openocd.cmd=bin/openocd
tools.openocd.cmd.windows=bin/openocd.exe

tools.openocd.upload.params.verbose=-d2
tools.openocd.upload.params.quiet=-d0
tools.openocd.upload.pattern="{path}/{cmd}" {upload.verbose} -s "{path}/share/openocd/scripts/" {bootloader.programmer} {bootloader.config} -c "telnet_port disabled; init; reset init; halt; adapter speed 10000; program {{build.path}/{build.project_name}.elf}; reset run; shutdown"

tools.openocd.program.params.verbose=-d2
tools.openocd.program.params.quiet=-d0
tools.openocd.program.pattern="{path}/{cmd}" {program.verbose} -s "{path}/share/openocd/scripts/" {bootloader.programmer} {bootloader.config} -c "telnet_port disabled; init; reset init; halt; adapter speed 10000; program {{build.path}/{build.project_name}.elf}; reset run; shutdown"

tools.openocd.erase.params.verbose=-d2
tools.openocd.erase.params.quiet=-d0
tools.openocd.erase.pattern=

tools.openocd.bootloader.params.verbose=-d2
tools.openocd.bootloader.params.quiet=-d0
tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/share/openocd/scripts/" {bootloader.programmer} {bootloader.config} -c "telnet_port disabled; init; reset init; halt; adapter speed 10000; {bootloader.extra_action.preflash}; program {{runtime.platform.path}/bootloaders/{bootloader.file}}; reset run; shutdown"

I'll look here:
https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification

Maybe there's a download I missed - I thought for a little while I had bricked my Potenta "wonders" H7.

Also noticed the _hs, _fs, and _hs_v2 versions of the bootloader.

Thanks In Advance,
John W.

mbed: v1.2.2 - whd_print_logbuffer() not found

Maybe this is just me - I had a 'glitch' when the 1.2.1 update to 1.2.2 occurred - but is anyone else seeing this:

c:\tmp\Display/Display.ino:503: undefined reference to whd_print_logbuffer' c:\AppData\Local\Temp\arduino_build_968917\libraries\WiFi\WiFi.cpp.o: In function wiced_filesystem_mount':
C:\Users\john\AppData\Local\Arduino15\packages\arduino-beta\hardware\mbed\1.2.2\libraries\WiFi\src/WiFi.cpp:294: undefined reference to `whd_print_logbuffer'

Thanks,
John
P.S. - Appears the file write was successful, though:
Sketch uses 276228 bytes (35%) of program storage space. Maximum is 786432 bytes.
Global variables use 65000 bytes (12%) of dynamic memory, leaving 458624 bytes for local variables. Maximum is 523624 bytes.

CI uses the latest mbed-beta core which is a placeholder release

To "smoothly" phase out the users from using the beta track of the mbed core we chose to mark it deprecated. To make the users get a notification about this we bumped the version to 1.3.1. That version is a dummy release though and the CI wants to use it. Let's change the CI to use the release version of the mbed core.

@per1234
@facchinm

Portenta AP Tutorial: AP Returns Subnet Mask 192.0.0.0 (1.2.1)

To repeat:

Run the AP tutorial - I've attached my files. // 1.2.1

When running the demo - it's returning this:

Wireless LAN adapter Wi-Fi:

Connection-specific DNS Suffix . :

IPv4 Address. . . . . . . . . . . : 192.168.3.3
Subnet Mask . . . . . . . . . . . : 192.0.0.0
Default Gateway . . . . . . . . . : 192.168.3.1

For purposes of the demo - wouldn't 255.255.255.0 be a better subnet mask?

Is there a way to change the subnet mask? (I'll take a look at the mbed stuff to see...).

Just wanted to point this out as I think it's causing some grief for some going through the tutorials.

Regards,
John W.

demo-web-server.zip

PS - It appears declaring something like this will correct the issue:
WiFi.config(IPAddress(192, 168, 4, 1)); // 1.2.2
PPS - OP 1.2.1 and not 1.2.2

High Density Connector Pin Names

@facchinm @sbhklr

With other ~30 pin Arduinos I understand pin names relate to ports, for example::

PA14, PB3, PC1, PD10

, but on the PortentaH7 we have potentially 160 Pins. That many pins must be confusing for the engineers but is basically ridiculous for any users. Any chance we could define all 160 pins by the logical names:

J1-1
J1-2
J1-3

J2-1
J2-2 etc, etc

So that users could actually write code that makes sense, like this for D6:

digitalWrite( J2-59 , LOW);

I don't think #defines take up any programming space in memory so I can't think of a reason not to simplify the naming on the Portenta pins.

WiFi AP status doesn't change when a client connects

In the example code there is this snipped which checks for new clients connecting to the AP:

// compare the previous status to the current status
  if (status != WiFi.status()) {
    // it has changed update the variable
    status = WiFi.status();

    if (status == WL_AP_CONNECTED) {
      // a device has connected to the AP
      Serial.println("Device connected to AP");
    } else {
      // a device has disconnected from the AP, and we are back in listening mode
      Serial.println("Device disconnected from AP");
    }
  }

The status doesn't seem to change even when a client successfully connects. I couldn't find any references in the WiFi library where WL_AP_CONNECTED is set. The example worked with an old version of the core as there was a hardcoded value being returned by the status function:

uint8_t arduino::WiFiClass::status() {
    // @todo: fix
    return WL_CONNECTED;
}

Probably we need to look into register_event_handler function of the WhdSoftAPInterface class. The documentation is quite limited and I couldn't find an example of how to implement it yet. https://os.mbed.com/docs/mbed-os/v6.3/feature-i2c-doxy/class_whd_soft_a_p_interface.html#a2ab8fabaa3c42aa60fc3d4438368d43f

Portenta Tutorial - MBED v. 1.9.5?

Hello,

Please see the attached pic - I only see version 1.2.1 - not 1.9.5 - I'm assuming this was a pre-beta release - but wanted to point it out since it can be a source of confusion when going through the tutorials.

Regards,
John W.
boardsmanager1p9p5

Portenta LED Pattern Decoder Ring

Hello,

I was wondering if we could get definitions of the LED patterns on the new Portenta M7 - e.g.:

*) Red LED - 4 Longs, 4 Shorts - what does that mean? (Something isn't right, but what's the meaning...)

I suppose this is in the code somewhere - but would be nice to have LED blink guide/decode sheet.

Thanks!
John W.

Set preferred connection parameters

Hey everyone,

with the change from ArduinoCore-nRF528x-mbedos to ArduinoCore-mbed we have some problems with the setPreferredConnectionParams() function.

If I understand this correctly the function moves from GAP (mbed 5) to GattServer (mbed >= 6.2.1). Unfortunately I dont see a way to change the connection parameter on mbed 6.0.0 which is currently used by ArduinoCore-mbed.

So my questions are:

  • Is there any way to set preferred connection paramter in mbed 6.0.0?
  • Is there a rough schedule when you want to switch to mbed 6.2.1 ?

Best regards

Read Out Protection

I know the STM32H747 chip has various levels of read/write protection available. I believe this functionality is usually enabled by setting certain registers via the ST Link CLI utility. Is there any plan to make this functionality available within the Arduino/mbed programmer?

(PC_2 and PC_3) ArduinoCore-mbed\cores\arduino\mbed\targets\target_stm\target_stm32h7\TARGET_STM32H747xI\target_portenta_h7\PinNames.h

Hello All,

In PinNames.h - are the PC_2 and PC_3 assignments correct?

I checked the schematic - doesn't match. My search/check of this list is not exhaustive.

/**** USB pins ****/
USB_OTG_FS_DM = PA_11,
USB_OTG_FS_DP = PA_12,
USB_OTG_FS_ID = PA_10,
USB_OTG_FS_SOF = PA_8,
USB_OTG_FS_VBUS = PA_9,
USB_OTG_HS_DM = PB_14,
USB_OTG_HS_DP = PB_15,
USB_OTG_HS_ID = PB_12,
USB_OTG_HS_SOF = PA_4,
USB_OTG_HS_ULPI_CK = PA_5,
USB_OTG_HS_ULPI_D0 = PA_3,
USB_OTG_HS_ULPI_D1 = PB_0,
USB_OTG_HS_ULPI_D2 = PB_1,
USB_OTG_HS_ULPI_D3 = PB_10,
USB_OTG_HS_ULPI_D4 = PB_11,
USB_OTG_HS_ULPI_D5 = PB_12,
USB_OTG_HS_ULPI_D6 = PB_13,
USB_OTG_HS_ULPI_D7 = PB_5,
USB_OTG_HS_ULPI_DIR = PC_2,
USB_OTG_HS_ULPI_NXT = PC_3,

USB_OTG_HS_ULPI_STP = PC_0,
USB_OTG_HS_VBUS = PB_13,

Thanks,
John W.

ADC and DAC not working

I made a post on the Arduino forum regarding an issue that I cannot get the DAC to work (see here).

I also noticed another post that a user is unable to get the ADC to work, which I have also verified (see here).

So, both ADC and DAC seem to be not working at the moment...

Crashing when writing more than 64 bytes to Serial

Writing more than 64 bytes to Serial on the Nano 33 BLE Sense board causes the board to crash and to start blinking the LED in the SOS pattern.

The following code reproduces the problem. The execution of the line that writes 65 bytes (buff_65) will crash.

/**
 * Demonstrate the bug on Nano BLE board when attempting to write more than 64 bytes
 * in one shot to the serial port.
 */
 
void setup() {
  // put your setup code here, to run once:

  Serial.begin(115200);
  delay(3000);
  
  const char *buff_64 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890a";
  Serial.println(strlen(buff_64));
  Serial.println(buff_64);

  const char *buff_65 = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890ab";
  Serial.println(strlen(buff_65));
  
  // This statement will cause the board to go into SOS mode.
  Serial.println(buff_65);

  Serial.println("If this line prints then the limit of 64 in a single shot is fixxed!");
  
}

void loop() {
  // put your main code here, to run repeatedly:

}

Port to NRF52840 with crystal 32Mhz and crystal 32Khz

Hi

I am trying to port a new chip with nrf52840 for this core, the module has two crystal 32Mhz and 32Khz, in other arduino core work fine
https://github.com/RAKWireless/RAK-nRF52-Arduino/tree/master/variants/WisCore_RAK4631_Board

and circuitpython working fine, but the two framework working with softdevice

My problem the bootloader work fine, but the blink not work for me, I have ported other chips and work fine, any possible problem with the glass or do you think it is something else?

Thanks!

[WiFi] Add a better method to store CA certificates

Right now, if using WiFiSSLClient, the sketch must declare a CA chain in this way

const char CA_CERTIFICATES[] = "-----BEGIN CERTIFICATE-----\n"
                               "MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\n"
                                ....
                               "5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\n"
                               "rqXRfboQnoZsG4q5WTP468SQvvG5\n"
                               "-----END CERTIFICATE-----\n";

Adding a default cert chain in the library should work but the flash occupation is not going to be negligible.
A better approach could involve using a filesystem mounted in the internal flash or the QSPI flash, which could be useful also for WiFi firmware.

Declaring abs define in Arduino.h breaks compatibility with TensorFlow Lite

Why is abs defined in the Arduino.h for this core?

This conflicts with std::abs usage f.e. in TensorFlow Lite. I think this has happened before in other cores, as there's a provision in TF already for this:

https://github.com/tensorflow/tensorflow/blob/845adc40a653b311f4df2c273b22de7e175a93a1/tensorflow/lite/type_to_tflitetype.h#L18

But it still required us to patch this undef in at a later point as well when porting EI to Portenta.

MKRRGB Doesn't Compile

To Reproduce:

In an portenta_m7 sketch:

#include <SPI.h>
#include <ArduinoGraphics.h>
#include <Arduino_MKRRGB.h>

Error Messages:
\Arduino-Pro-Sketch\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp:25:29: error: 'sercom0' was not declared in this scope
 static SPIClass SPI_MATRIX(&sercom0, A3, A4, A3, SPI_PAD_0_SCK_1, SERCOM_RX_PAD_0);
                             ^~~~~~~
\Arduino-Pro-Sketch\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp:25:29: note: suggested alternative: 'strcoll'
 static SPIClass SPI_MATRIX(&sercom0, A3, A4, A3, SPI_PAD_0_SCK_1, SERCOM_RX_PAD_0);
                             ^~~~~~~
                             strcoll
\Arduino-Pro-Sketch\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp:25:50: error: 'SPI_PAD_0_SCK_1' was not declared in this scope
 static SPIClass SPI_MATRIX(&sercom0, A3, A4, A3, SPI_PAD_0_SCK_1, SERCOM_RX_PAD_0);
                                                  ^~~~~~~~~~~~~~~
\Arduino-Pro-Sketch\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp:25:50: note: suggested alternative: 'SPI_CFG2_SP_1'
 static SPIClass SPI_MATRIX(&sercom0, A3, A4, A3, SPI_PAD_0_SCK_1, SERCOM_RX_PAD_0);
                                                  ^~~~~~~~~~~~~~~
                                                  SPI_CFG2_SP_1
\Arduino-Pro-Sketch\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp:25:67: error: 'SERCOM_RX_PAD_0' was not declared in this scope
 static SPIClass SPI_MATRIX(&sercom0, A3, A4, A3, SPI_PAD_0_SCK_1, SERCOM_RX_PAD_0);
                                                                   ^~~~~~~~~~~~~~~
\Arduino-Pro-Sketch\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp: In member function 'virtual int RGBMatrixClass::begin()':
\Arduino-Pro-Sketch\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp:74:21: error: 'PIO_SERCOM_ALT' was not declared in this scope
   pinPeripheral(A3, PIO_SERCOM_ALT);
                     ^~~~~~~~~~~~~~
\Arduino-Pro-Sketch\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp:74:21: note: suggested alternative: 'PIN_SERIAL_TX'
   pinPeripheral(A3, PIO_SERCOM_ALT);
                     ^~~~~~~~~~~~~~
                     PIN_SERIAL_TX
\Arduino-Pro-Sketch\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp:74:3: error: 'pinPeripheral' was not declared in this scope
   pinPeripheral(A3, PIO_SERCOM_ALT);
   ^~~~~~~~~~~~~
\Arduino-Pro-Sketch\libraries\Arduino_MKRRGB\src\MKRRGBMatrix.cpp:74:3: note: suggested alternative: 'pinmap_peripheral'
   pinPeripheral(A3, PIO_SERCOM_ALT);
   ^~~~~~~~~~~~~
   pinmap_peripheral
Compilation error: Error: 2 UNKNOWN: exit status 1

Regards,
John W.

mBED runs javascript, what are the Portenta plans?

Can someone perhaps @janjongboom, @sbhklr or @facchinm reply about the possible direction Arduino is taking with Javascript implementation. I am doing fairly well at getting things working. See my github at https://github.com/hpssjellis/my-examples-for-the-arduino-portentaH7

Mbed runs javascript https://os.mbed.com/blog/entry/Bringing-JavaScript-to-mbed-OS/ which would make the most sense. Is that the most plausible direction? Does anyone have any starting perhaps javascript blink code they think might work but it just needs a few tweaks. I am willing to work on this, as I have most of what I need from the Portenta working so far.

Bootloader Build Definitions, Please

Can definitions/descriptions be provided for the following:

portentah7_bootloader_mbed_fs.bin *** results in DL2 being solidly lit - OLoD - Orange LED of Doom.
portentah7_bootloader_mbed_fs.elf

portentah7_bootloader_mbed_hs.bin
portentah7_bootloader_mbed_hs.elf

portentah7_bootloader_mbed_hs_v2.bin **** works with the Portenta H7 that I have received.
portentah7_bootloader_mbed_hs_v2.elf

Thanks,
John W.

Portenta Bootloader Source?

I am looking into adding FOTA (Firmware Over-The-Air) updates to my Portenta. After a bit of research I found this wiki page, However it looks like the bootloader needs to be modified for FOTA updates to work.
Searching for the Portanta bootloader source yielded no results, so I'm not sure if it just uses a generic mbed bootloader or a custom bootloader.

If it's a custom bootloader is it open source or is there any plans to release the source code?

Thanks,
-Ashton

USBHOST is not reliable with some USB C dongles

Hub initialization will fail with some error like

RHUB HS:0      Connect
RHUB HS:0      Enable
DEV  HS.00     Allocate pipe, in = 0, out = 1
DEV  HS.00     Setup stage fail, TUSB_CS_TRANSACTION_ERROR
DEV  HS.00     Fail to get device descriptor
RHUB HS:0      Device attach failed

Check if 96bit CDC iSerial is compatible with Windows

316e033 introduced a long iSerial field, using all available UID fields.
We received a report that after applying this patch the board is no more recognized in Windows.
Before reverting it would be nice to test it again on clean (and dirty) installations.

.\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino13\bin\openocd.exe - Goes To Zero Bytes During Programming

I'm not 100% certain how to reproduce this - but I will try in the near future but want to report what happened:

I was trying to restore the bootloader on the Portenta H7 - when all of a sudden I got a message:

'File cannot be run by this PC' - or a similar message. I didn't do a screen shot since at first I thought it was just a path issue or something like that - I finally looked in the directory:

C:\Users\john\AppData\Local\Arduino15\packages\arduino\tools\openocd\0.10.0-arduino13\bin -
and the openocd.exe file was there - but was zero bytes.

I since have restored it and I put the read-execute only flag on it so it can't be deleted or written to as easily - but I wanted to report this just in case this isn't some kind of one-off and someone else is seeing it.

Regards,
John W.

Portenta: Excessive Resets By H7 Results In USB I/F Not Being Recognized

To All:

First, not sure if this is the 'right' place to report this issue - but - it's somewhat related to the discussion in #42 and I just wanted to post in case someone else is seeing it or maybe someone else has a better workaround than what I've been able to do:

When attempting to debug and building debug builds, sometimes the Portenta goes into a 'reset mode' for lack of a better term - it'll reset to the point the PC no longer recognizes the USB port.

The only effective way I've been able to workaround this issue is to simply shut everything down and reboot.

I tried to uninstall the USB drivers and reinstall - but they will hang seemingly indefinitely when this occurs.

Does anyone else have a better solution and/or has anyone else experienced this?

I realize this could be a USB driver/PC issue but wanted to know if anyone has any better ideas.

Thanks In Advance,
John W.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.