IDE2 RC5 Not Upload'ing for STM32 sometimes

Hello, Strange Problem.
Win10 i5 loads of ram STLINK V3
I have several STM32F411CE projects i am currently working and this evening after major PC Win 10 rebuild I tried to Edit, Compile and Upload one of them. The program compiles just fine then the process just stops and makes no attempt to upload the program which is about 150 lines including blanks and comment. I have appended it but please don't be critical as is work in progress. The program however compiled and upload just fine with IDE2 RC4 couple of days ago.

So I tried the simple blink example on a NANO and it compiled and uploaded fine, then I recompiled and upload blinky to the STM32F411CE and it worked just fine.

So i opened up the little 150 line com app i am working on and it complies, but just ignores the upload phased.

PS I there a download location for RC4 as I use it and await rc6

Many thanks in advance IMK

#include <arduino.h>

#define OUTPUT_TEST_PIN PC13 // Black Pill STM32411CE (LED)

#define LED_BUILTIN_BLACK_PILL OUTPUT_TEST_PIN

#define TRUE 1

#define FALSE 0

#define OUTPUT_MSG_SIZE 128

#define MAX_NUMBER_OF_MSGS_IN_OUTPUT_QUEUE 8

struct OutPutMsg

{

char Msg[ OUTPUT_MSG_SIZE ];

};

struct OutPutMsgQueue

{

int NextMsgInIdx;

int NextMsgOutIdx;

struct OutPutMsg OutPutMsgQueueItem[ MAX_NUMBER_OF_MSGS_IN_OUTPUT_QUEUE ];

};

struct OutPutMsgQueue OutPutMsgQueue;

void WriteMsgToOutPutQueue( char TheMsg[] );

int ReadMsgFromOutPutQueue( char TheMsg[] );

//#define MS_WAIT_BEFORE_REPLY 100 // Ran 1hr ok, sometime get bad rx msg so changed to 50 for testing

#define MS_WAIT_BEFORE_REPLY 50 // // This works much better as no skipped messages

//#define MS_WAIT_BEFORE_REPLY 25 //

//#define MS_WAIT_BEFORE_REPLY 10

volatile int RxStringComplete = FALSE;

void OneMilliSecIntFromTimer( void );

HardwareSerial Serial2( PA3 , PA2 ); // Rx Tx

// ------------------------------------- WriteMsgToOutPutQueue() ---------------------------------------

void WriteMsgToOutPutQueue( char TheMsg[] )

{

strcpy( OutPutMsgQueue.OutPutMsgQueueItem[ OutPutMsgQueue.NextMsgInIdx++ ].Msg , TheMsg );

if( OutPutMsgQueue.NextMsgInIdx >= MAX_NUMBER_OF_MSGS_IN_OUTPUT_QUEUE ) // See if queue has wrapped

OutPutMsgQueue.NextMsgInIdx = 0;

}

// -------------------------------------- ReadMsgFromOutPutQueue() -------------------------------------

int ReadMsgFromOutPutQueue( char TheMsg[] )

{

if( OutPutMsgQueue.NextMsgOutIdx != OutPutMsgQueue.NextMsgInIdx ) // See if msg in queue

{ // Yip got one to get :slight_smile:

strcpy( TheMsg , OutPutMsgQueue.OutPutMsgQueueItem[ OutPutMsgQueue.NextMsgOutIdx++ ].Msg ); // copy message

if( OutPutMsgQueue.NextMsgOutIdx >= MAX_NUMBER_OF_MSGS_IN_OUTPUT_QUEUE ) // See if queue has wrapped

OutPutMsgQueue.NextMsgOutIdx = 0;

}

else

return( FALSE ); // No msg in Queue

return( TRUE ); // // Returned caller a msg from Queue

}

// --------------------------------------------------------- setup() ------------------------------------------

void setup()

{

pinMode(LED_BUILTIN_BLACK_PILL, OUTPUT);

TIM_TypeDef *Instance = TIM1; // or TIM2, But T2 is used by PWM Motor Control

Serial1.begin( 38400 );

Serial2.begin( 38400 ); // Second serial port TX PA2 RX PA3

// Instantiate HardwareTimer object. Thanks to 'new' instanciation, HardwareTimer is not destructed when setup() function is finished.

HardwareTimer *MyTim = new HardwareTimer(Instance);

MyTim->setOverflow( 1000 , HERTZ_FORMAT); // 1000 Hz

MyTim->attachInterrupt( OneMilliSecIntFromTimer );

MyTim->resume(); // Set the interrupt Timer

//Serial1.print( SlaveTxMsg );

//Serial1.println( );

}

volatile int HostMsgRxed; // tmp flag

char FromHostRxMsgBuf[128];

int FromHostRxMsgIdx;

// ------------------------------------------ loop() -------------------------------

void loop()

{

if( HostMsgRxed && RxStringComplete ) // See if a msg from the host

{

delay( MS_WAIT_BEFORE_REPLY ); // Radio Modem Minimum Turn aRound Time

RxStringComplete = FALSE;

HostMsgRxed = FALSE;

Serial1.print( FromHostRxMsgBuf );

// Serial2.print( "123" ); // For testing

//Serial2.println( ); // For testing

}

delay(1);

}

// ------------------------------------------------ OneMilliSecIntFromTimer() ------------------------------------

void OneMilliSecIntFromTimer( void )

{ // Toggle pin. 10hz toogle --> 5Hz PWM

char RxChar;

//static char RxMsgBuf[128];

//static int RxMsgIdx;

// Rx message from host to be sent in time slot to ERIN Motor Sensors

while( Serial2.available() )

{

RxChar = Serial2.read();

FromHostRxMsgBuf[ FromHostRxMsgIdx++ ] = RxChar;

if( RxChar == '\n' )

{

// digitalWrite( LED_BUILTIN_BLACK_PILL , !digitalRead( LED_BUILTIN_BLACK_PILL ) );

FromHostRxMsgBuf[ FromHostRxMsgIdx ] = 0;

HostMsgRxed = TRUE;

FromHostRxMsgIdx = 0;

// RxMsgIdx = 0;

}

} // end while have data Serial 1

// Rx message from ERIN Motor Sensor.... Msg end is just just to creat message send from host time slot

while( Serial1.available() )

{

RxChar = Serial1.read();

//RxMsgBuf[ RxMsgIdx++ ] = RxChar;

if( RxChar == '\n' )

{

// RxMsgIdx = 0;

if( HostMsgRxed )

{ // Got a host msg so wait until we have rx ERIN M/S msg to sync with

RxStringComplete = TRUE;

digitalWrite( LED_BUILTIN_BLACK_PILL , !digitalRead( LED_BUILTIN_BLACK_PILL ) );

}

}

} // end while have data Serial 1

} // End OneMilliSecIntFromTimer() Proc

Hi @imk123. In order to gather more information that might help us to troubleshoot your problem, I'm going to ask you to post the full output from the upload when in verbose mode.

Please do this:

  1. Select File > Preferences from the Arduino IDE menus.
  2. Check the checkbox next to Show verbose output during: ☐ upload.
  3. Click the OK button.
  4. Attempt an upload, as you did before.
  5. After the upload fails, right click on the black "Output" pane at the bottom of the Arduino IDE 2.x window.
  6. From the context menu, click Copy All.
    This copies the full output to the clipboard.
  7. Open a forum reply here by clicking the Reply button.
  8. Click the </> icon on the post composer toolbar.
    This will add the forum's code block markup (```) to your reply to make sure the error messages are correctly formatted.
    Code block
  9. Press Ctrl+V.
    This will paste the error output from the upload into the code block.
  10. Move the cursor outside of the code tags before you add any additional text to your reply.
  11. Click the Reply button to post the output.

Arduino IDE 2.0.0-rc4 is available for download from the "Assets" section of this page:

Hello ptillisch and many thanks for the most prompt reply.
Did what you asked and still ZERO output when pressing upload or menu Sketch Upload.
Then I noticed bottom right STM32F4 not connected!
So i menu'ed Tool->Port and selected the STLINK V3 comm port and Sketch built and uploaded.
This is not something i remember having to do in RC4 as I set menu
Tools->Upload Method -> STM32CUBEProgrammer (SWD)
So either I have missed something or something has changed.
Must be me as have had week offline with Update LAN issues and am stressed out.
Either way projects on the move again, many thanks for help imk
either way

Yes, something has changed. There was a regression that caused uploading to only be enabled when a port is selected, even though that is wrong because not all boards use a port for uploading.

It is being tracked by the Arduino IDE developers here:

If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject.


The workaround, as you already discovered, is to select any arbitrary port from the Tools > Port menu in the Arduino IDE.

hello ptillisch and thanks for the update.
So not all my fault , but main thing is we are making progress and i fully understand this is tricky time for IDE2 development. As with any big software project at the beginning there are many issues and nothing works to well, then in the middle everything start coming together and great progress is made. Then in the final phase prior to release there are lost of little wrinkles to sort out. But you are making fine progress and I can't wait for IDE2 V1.
So big thanks for the help again: there is a special place in heaven for ARDUINO support and develops of this project and i only wish i could contribute more.
imk

You are welcome, and thanks so much for your positivity @imk123

Regards,
Per

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.