arduino / ArduinoCore-mbed

345 stars 199 forks source link

Can't Use PWM with Nicla Vision #641

Closed alwint3r closed 1 year ago

alwint3r commented 1 year ago

I needed to send PWM signals, but when I tried using either analogWrite or mbed::PwmOut the linker always yield the following error:

pwmout_api.c:(.text.pwmout_init+0x310): undefined reference to `PinMap_PWM_HRTIM'

The version that I used is 3.5.4.

Update: Also not working with 4.0.2 version.

facchinm commented 1 year ago

Wow, thanks for spotting! It's indeed an issue on our mbed-os fork, I just pushed https://github.com/arduino/mbed-os/commit/a41dabe711c5d9c041cfb6e675bbb6825ec708d1 to fix it. The proper core release will be available in the next few weeks, but in the meantime you can just copy the patch content (without WEAK ) in your sketch to get it compiling.

alwint3r commented 1 year ago

Thank you @facchinm, I'll try it out.

rneurink commented 1 year ago

@alwint3r Have you got it working? Even with this patch the whole board stalls. Windows also notes the USB port is not recognized.

I've compared the mbed core to the STM32H7474 discovery board. Arduino uses the high resolution timer or HRTIM for short. Maybe there's a problem with its implementation.

rneurink commented 1 year ago

With Mbed trace

++ MbedOS Error Info ++ Error Status: 0x80010130 Code: 304 Module: 1 Error Message: pinmap not found for peripheral Location: 0x8046A0F Error Value: 0x2D Current Thread: main Id: 0x24003050 Entry: 0x80443F5 StackSize: 0x8000 StackMem: 0x24003A18 SP: 0x2400B88C For more info, visit: https://mbed.com/s/error?error=0x80010130&osver=61700&core=0x411FC271&comp=2&ver=90200&tgt=NICLA_VISION -- MbedOS Error Info --