stm32duino / Arduino_Tools

Contains upload tools for STM32 based boards
Other
87 stars 63 forks source link

Cannot upload sketch on MacOS #99

Open miroslavpetrov opened 3 days ago

miroslavpetrov commented 3 days ago

Describe the bug I am also not able to upload sketches from the Arduino IDE on MacOS. I have STM32cubeprog installed and working on my Mac but thats what I get from the Arduino IDE:

Sketch uses 110728 bytes (42%) of program storage space. Maximum is 262144 bytes.
Global variables use 8648 bytes (13%) of dynamic memory, leaving 56888 bytes for local variables. Maximum is 65536 bytes.
getopt: illegal option -- o
Terminating...
Failed uploading: uploading error: exit status 1

To Reproduce Steps to reproduce the behavior: No matter what upload method I select - SWD, UART, DFU the output is the same. I am only able to upload the sketch by exporting compiled binary, open sketch folder in finder and move the .bin file to STLink drive.

Expected behavior I expect to be able to flash STM32WL using Arduino IDE

Desktop

Board (please complete the following information):

fpistm commented 3 days ago

Hi @miroslavpetrov Thanks for the detailed description but it seems you talk about several one. One about an issue already opened (using the workaround begin(true)). One other about I2C not working after a wake up (and serial)? And one about a download issue.

Moreover it is not clear which board you select in the menu, is itLoRa-E5 mini About upload method, the drag and drop is not supported by default so which upload method failed?

Here it is for bug related to the core. Please split your issue in the correct way: Comment about the rtc.begin(true) in the correct issue (https://github.com/stm32duino/STM32LoRaWAN/issues/36) About low power (i2c/Serial) create a new issue in the LoRaWan library. About upload method, clean up this issue and detail exactly your setup (selected board in the menu and the upload method selected))

miroslavpetrov commented 3 days ago

@fpistm Thanks for the quick response. I have mentioned I2C,Serial and Sleep issues at once because I think that they are linked together to the improper set of the clock source for the RTC.I will clean the issue and create new ones as you told me.

fpistm commented 3 days ago

improper set of the clock source for the RTC.

As stated in other PR, there is no improper clock source for the RTC, As even the modem.begin() call the reset, we are not able to reproduce on our side this seems happen only with third party board and so hard to explain.

fpistm commented 3 days ago

Hi @miroslavpetrov I've found the issue. Please, Could you try the fix provided within #99?

miroslavpetrov commented 3 days ago

@fpistm Thank you. Now it works like a charm. I am closing the issue.

Sketch uses 128352 bytes (48%) of program storage space. Maximum is 262144 bytes.
Global variables use 8652 bytes (13%) of dynamic memory, leaving 56884 bytes for local variables. Maximum is 65536 bytes.
Selected interface: swd
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.14.0                  
      -------------------------------------------------------------------

ST-LINK SN  : 0032001B3431511837393330
ST-LINK FW  : V3J12M3
Board       : STLINK-V3MINIE
Voltage     : 3.30V
SWD freq    : 8000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x497
Revision ID : Rev Z
Device name : STM32WLxx
Flash size  : 256 KBytes
Device type : MCU
Device CPU  : Cortex-M4
BL Version  : 0xC3

Memory Programming ...
Opening and parsing file: LowPowerBasic.ino.bin
  File          : LowPowerBasic.ino.bin
  Size          : 125.71 KB 
  Address       : 0x08000000 

Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 62]
Download in Progress:

File download complete
Time elapsed during download operation: 00:00:03.323

RUNNING Program ... 
  Address:      : 0x8000000
Application is running, Please Hold on...
Start operation achieved successfully
fpistm commented 2 days ago

Hi @miroslavpetrov Thanks for the test. I reopen the issue as the PR is not merged. I have some other concern about BSD getopt limitation (when arguments have space) and I need to validate under windows. Issue will be closed automatically when the PR will be merged.