Topics

Failed to init device yet again


Gerry Byrne
 

I continue to receive the following error messages (see below this message) when attempting to flash the STM32 with Onstep.

I have reloaded all the appropriate software libraries, etc, and the sketch compiles  without problems. Uploading is the problem. 

I have replaced both the STM32 Blue Pill and the CP2102 to no avail. My laptop now recognises the CP2102 and has allocated it to Com 3 (previously I got a "device is faulty" message). It flashes red about four times when the USB is connected then remains a steady red.

The new STM32 Blue Pill has a power light (red) on when the PCB power supply (5V) is connected. However it also has a rapid flashing green LED. Is this normal?

Gerry Byrne

Error Message:

Failed to init device 
stm32flash 0.4
 
http://stm32flash.googlecode.com/
 
Using Parser : Raw BINARY
Interface serial_w32: 115200 8E1
 
Invalid library found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink: no headers files (.h) found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink
Invalid library found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink: no headers files (.h) found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink
 
--
Copernicus


Dave Schwartz
 

Is the flashing green LED the behavior of the STM32 before you have uploaded anything to it? If so, that is normal because there is a default blink program uploaded to it as a test step during fabrication. All the ones I have had did that.

I have no idea what the 'Invalid library' could be... not the foggiest idea why something would be trying to access something from the blink sketch an during OnStep build unless you have somehow corrupted the OnStep directory with blink sketch code. A complete wipe of the OnStep directory and refresh from the repository might be needed.

Please describe, in excruciating detail, the steps you are performing when preparing the STM32 for the upload and restoring it to run mode. Perhaps include detailed descriptions or a picture of how the flash/run switch is connected to the header on the STM32 (or the configuration of the jumpers if you are not using the switch). This has been conquered by literally hundreds of people so there must be something in the sequence that you are doing that is incorrect but you don't recognize it because you've never seen it work successfully. Nothing worse than having a procedure wrong and doing it over and over expecting a different result because you haven't realized a tiny error. Been there, done that.

On 2020-07-15 8:24 a.m., Gerry Byrne wrote:
I continue to receive the following error messages (see below this message) when attempting to flash the STM32 with Onstep.

I have reloaded all the appropriate software libraries, etc, and the sketch compiles  without problems. Uploading is the problem.

I have replaced both the STM32 Blue Pill and the CP2102 to no avail. My laptop now recognises the CP2102 and has allocated it to Com 3 (previously I got a "device is faulty" message). It flashes red about four times when the USB is connected then remains a steady red.

The new STM32 Blue Pill has a power light (red) on when the PCB power supply (5V) is connected. However it also has a rapid flashing green LED. Is this normal?

Gerry Byrne

Error Message:

*Failed to init device *
*stm32flash 0.4*
*http://stm32flash.googlecode.com/*
*Using Parser : Raw BINARY*
*Interface serial_w32: 115200 8E1*
*Invalid library found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink: no headers files (.h) found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink*
*Invalid library found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink: no headers files (.h) found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink*
--
*Copernicus*


Drew 🔭📷🚴‍♂️
 

On Wed, Jul 15, 2020 at 10:05 AM, Dave Schwartz wrote:
unless you have somehow corrupted the OnStep directory with blink sketch code
I believe that is exactly what he has done. Not everyone understands that the Arduino IDE uses the directory as a build directory. It will blindly try to incorporate any file with a valid (Arduino recognized) extension in the directory. I will often rename unused files to have an unrecognized extensions such "org" to avoid this issue.


Gerry Byrne
 

Dave,
Yes, it's a brand new replacement STM32 and it flashed from the get-go, before I attempted to upload anything to it.

I think you may have a point about the blink sketch (Drew makes a similar point). I never realised Arduino behaved like that. But would that completely explain the failure to initialise?

Since writing earlier I did a circuit test on links between the CP2102 and the STM board. One pin on the CP2102 appeared slightly loose with an intermittent circuit  between it and A10 on the Blue Pill and I re-soldered it and the connection is now perfect between RX, Tx and A9 and A10.. But still I cannot upload.

Here, in excruciating detail, is what I have been doing.

I unplug everything. Move the switch to flash. Power up via the 5V supply on the PCB. Red LED lights, Green LED flashes.  Then plug USB from the laptop to the CP2102. Instruct the IDE to upload the Onstep sketch. It compiles and then goes into upload mode. It says "done uploading" but inspection reveals the "failed to init device" message again along with the other stuff about blink. I repeat by depowering, unplugging the USB and repowering and reinserting the USB plug followed by another attempt at uploading.

My board settings are as in the attached photo. COM Port is not shown but it is COM 3 and this is confirmed by Device Settings. When I changed it to COM 2, the IDE went looking for COM 3 and I changed it back.

I attach other pics attempting to show the switch connections to the Blue Pill.

Many thanks for your interest.
Gerry

On 15/07/2020 15:05, Dave Schwartz wrote:
Is the flashing green LED the behavior of the STM32 before you have uploaded anything to it? If so, that is normal because there is a default blink program uploaded to it as a test step during fabrication. All the ones I have had did that.

I have no idea what the 'Invalid library' could be... not the foggiest idea why something would be trying to access something from the blink sketch an during OnStep build unless you have somehow corrupted the OnStep directory with blink sketch code. A complete wipe of the OnStep directory and refresh from the repository might be needed.

Please describe, in excruciating detail, the steps you are performing when preparing the STM32 for the upload and restoring it to run mode. Perhaps include detailed descriptions or a picture of how the flash/run switch is connected to the header on the STM32 (or the configuration of the jumpers if you are not using the switch). This has been conquered by literally hundreds of people so there must be something in the sequence that you are doing that is incorrect but you don't recognize it because you've never seen it work successfully. Nothing worse than having a procedure wrong and doing it over and over expecting a different result because you haven't realized a tiny error. Been there, done that.

On 2020-07-15 8:24 a.m., Gerry Byrne wrote:
I continue to receive the following error messages (see below this message) when attempting to flash the STM32 with Onstep.

I have reloaded all the appropriate software libraries, etc, and the sketch compiles  without problems. Uploading is the problem.

I have replaced both the STM32 Blue Pill and the CP2102 to no avail. My laptop now recognises the CP2102 and has allocated it to Com 3 (previously I got a "device is faulty" message). It flashes red about four times when the USB is connected then remains a steady red.

The new STM32 Blue Pill has a power light (red) on when the PCB power supply (5V) is connected. However it also has a rapid flashing green LED. Is this normal?

Gerry Byrne

Error Message:

*Failed to init device *
*stm32flash 0.4*
*http://stm32flash.googlecode.com/*
*Using Parser : Raw BINARY*
*Interface serial_w32: 115200 8E1*
*Invalid library found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink: no headers files (.h) found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink*
*Invalid library found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink: no headers files (.h) found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink*
--
*Copernicus*
--
*Copernicus*


Dave Schwartz
 

I'm going to assume that the COM port you are selecting in the IDE is the one that appears when you connect the CP2102. Are you actually selecting that from the 'Port' flyout ? Your picture doesn't show a port as being selected. You have to actually select it, its not good enough that it just be in the flyout list.

Let's eliminate that wiring harness to the flash-run switch. Go back to using the original jumper. The existing yellow jumper on BOOT1 is where it always stays, bridging the center and '0' end pins. Put the one on the BOOT0 header... the same end as BOOT1 is the run position and the opposite (bridging the center and '1') end pins is the flash position. I believe the green LED should not be active when in flash mode because not even the original blink sketch will be running in that mode.

On 2020-07-15 11:40 a.m., Gerry Byrne wrote:
Dave,
Yes, it's a brand new replacement STM32 and it flashed from the get-go, before I attempted to upload anything to it.

I think you may have a point about the blink sketch (Drew makes a similar point). I never realised Arduino behaved like that. But would that completely explain the failure to initialise?

Since writing earlier I did a circuit test on links between the CP2102 and the STM board. One pin on the CP2102 appeared slightly loose with an intermittent circuit  between it and A10 on the Blue Pill and I re-soldered it and the connection is now perfect between RX, Tx and A9 and A10.. But still I cannot upload.

Here, in excruciating detail, is what I have been doing.

I unplug everything. Move the switch to flash. Power up via the 5V supply on the PCB. Red LED lights, Green LED flashes.  Then plug USB from the laptop to the CP2102. Instruct the IDE to upload the Onstep sketch. It compiles and then goes into upload mode. It says "done uploading" but inspection reveals the "failed to init device" message again along with the other stuff about blink. I repeat by depowering, unplugging the USB and repowering and reinserting the USB plug followed by another attempt at uploading.

My board settings are as in the attached photo. COM Port is not shown but it is COM 3 and this is confirmed by Device Settings. When I changed it to COM 2, the IDE went looking for COM 3 and I changed it back.

I attach other pics attempting to show the switch connections to the Blue Pill.

Many thanks for your interest.
Gerry









On 15/07/2020 15:05, Dave Schwartz wrote:
Is the flashing green LED the behavior of the STM32 before you have uploaded anything to it? If so, that is normal because there is a default blink program uploaded to it as a test step during fabrication. All the ones I have had did that.

I have no idea what the 'Invalid library' could be... not the foggiest idea why something would be trying to access something from the blink sketch an during OnStep build unless you have somehow corrupted the OnStep directory with blink sketch code. A complete wipe of the OnStep directory and refresh from the repository might be needed.

Please describe, in excruciating detail, the steps you are performing when preparing the STM32 for the upload and restoring it to run mode. Perhaps include detailed descriptions or a picture of how the flash/run switch is connected to the header on the STM32 (or the configuration of the jumpers if you are not using the switch). This has been conquered by literally hundreds of people so there must be something in the sequence that you are doing that is incorrect but you don't recognize it because you've never seen it work successfully. Nothing worse than having a procedure wrong and doing it over and over expecting a different result because you haven't realized a tiny error. Been there, done that.

On 2020-07-15 8:24 a.m., Gerry Byrne wrote:
I continue to receive the following error messages (see below this message) when attempting to flash the STM32 with Onstep.

I have reloaded all the appropriate software libraries, etc, and the sketch compiles  without problems. Uploading is the problem.

I have replaced both the STM32 Blue Pill and the CP2102 to no avail. My laptop now recognises the CP2102 and has allocated it to Com 3 (previously I got a "device is faulty" message). It flashes red about four times when the USB is connected then remains a steady red.

The new STM32 Blue Pill has a power light (red) on when the PCB power supply (5V) is connected. However it also has a rapid flashing green LED. Is this normal?

Gerry Byrne

Error Message:

*Failed to init device *
*stm32flash 0.4*
*http://stm32flash.googlecode.com/*
*Using Parser : Raw BINARY*
*Interface serial_w32: 115200 8E1*
*Invalid library found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink: no headers files (.h) found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink*
*Invalid library found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink: no headers files (.h) found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink*
--
*Copernicus*



Drew 🔭📷🚴‍♂️
 

On Wed, Jul 15, 2020 at 03:41 PM, Dave Schwartz wrote:
I'm going to assume that the COM port you are selecting in the IDE is the one that appears when you connect the CP2102.
A quick test to be sure something Arduino is on the selected COM port is to press the "Get Board info" selection under the Port. You can ignore the information itself, only a live port will open up the info box. No info box, you have the wrong port.


Gerry Byrne
 

Dave,
Thanks for your detailed response. I Will check your suggestions on the Com issue. It is so obvious, I suppose. 
Tomorrow I'll also try a switch free flash.
Gerry

On Wed 15 Jul 2020, 20:41 Dave Schwartz, <Dave.Schwartz@...> wrote:
I'm going to assume that the COM port you are selecting in the IDE is
the one that appears when you connect the CP2102. Are you actually
selecting that from the 'Port' flyout ? Your picture doesn't show a port
as being selected. You have to actually select it, its not good enough
that it just be in the flyout list.

Let's eliminate that wiring harness to the flash-run switch. Go back to
using the original jumper. The existing yellow jumper on BOOT1 is where
it always stays, bridging the center and '0' end pins. Put the one on
the BOOT0 header... the same end as BOOT1 is the run position and the
opposite (bridging the center and '1') end pins is the flash position. I
believe the green LED should not be active when in flash mode because
not even the original blink sketch will be running in that mode.

On 2020-07-15 11:40 a.m., Gerry Byrne wrote:
> Dave,
> Yes, it's a brand new replacement STM32 and it flashed from the
> get-go, before I attempted to upload anything to it.
>
> I think you may have a point about the blink sketch (Drew makes a
> similar point). I never realised Arduino behaved like that. But would
> that completely explain the failure to initialise?
>
> Since writing earlier I did a circuit test on links between the CP2102
> and the STM board. One pin on the CP2102 appeared slightly loose with
> an intermittent circuit  between it and A10 on the Blue Pill and I
> re-soldered it and the connection is now perfect between RX, Tx and A9
> and A10.. But still I cannot upload.
>
> Here, in excruciating detail, is what I have been doing.
>
> I unplug everything. Move the switch to flash. Power up via the 5V
> supply on the PCB. Red LED lights, Green LED flashes.  Then plug USB
> from the laptop to the CP2102. Instruct the IDE to upload the Onstep
> sketch. It compiles and then goes into upload mode. It says "done
> uploading" but inspection reveals the "failed to init device" message
> again along with the other stuff about blink. I repeat by depowering,
> unplugging the USB and repowering and reinserting the USB plug
> followed by another attempt at uploading.
>
> My board settings are as in the attached photo. COM Port is not shown
> but it is COM 3 and this is confirmed by Device Settings. When I
> changed it to COM 2, the IDE went looking for COM 3 and I changed it
> back.
>
> I attach other pics attempting to show the switch connections to the
> Blue Pill.
>
> Many thanks for your interest.
> Gerry
>
>
>
>
>
>
>
>
>
> On 15/07/2020 15:05, Dave Schwartz wrote:
>> Is the flashing green LED the behavior of the STM32 before you have
>> uploaded anything to it? If so, that is normal because there is a
>> default blink program uploaded to it as a test step during
>> fabrication. All the ones I have had did that.
>>
>> I have no idea what the 'Invalid library' could be... not the
>> foggiest idea why something would be trying to access something from
>> the blink sketch an during OnStep build unless you have somehow
>> corrupted the OnStep directory with blink sketch code. A complete
>> wipe of the OnStep directory and refresh from the repository might be
>> needed.
>>
>> Please describe, in excruciating detail, the steps you are performing
>> when preparing the STM32 for the upload and restoring it to run mode.
>> Perhaps include detailed descriptions or a picture of how the
>> flash/run switch is connected to the header on the STM32 (or the
>> configuration of the jumpers if you are not using the switch). This
>> has been conquered by literally hundreds of people so there must be
>> something in the sequence that you are doing that is incorrect but
>> you don't recognize it because you've never seen it work
>> successfully. Nothing worse than having a procedure wrong and doing
>> it over and over expecting a different result because you haven't
>> realized a tiny error. Been there, done that.
>>
>> On 2020-07-15 8:24 a.m., Gerry Byrne wrote:
>>> I continue to receive the following error messages (see below this
>>> message) when attempting to flash the STM32 with Onstep.
>>>
>>> I have reloaded all the appropriate software libraries, etc, and the
>>> sketch compiles  without problems. Uploading is the problem.
>>>
>>> I have replaced both the STM32 Blue Pill and the CP2102 to no avail.
>>> My laptop now recognises the CP2102 and has allocated it to Com 3
>>> (previously I got a "device is faulty" message). It flashes red
>>> about four times when the USB is connected then remains a steady red.
>>>
>>> The new STM32 Blue Pill has a power light (red) on when the PCB
>>> power supply (5V) is connected. However it also has a rapid flashing
>>> green LED. Is this normal?
>>>
>>> Gerry Byrne
>>>
>>> Error Message:
>>>
>>> *Failed to init device *
>>> *stm32flash 0.4*
>>> *http://stm32flash.googlecode.com/*
>>> *Using Parser : Raw BINARY*
>>> *Interface serial_w32: 115200 8E1*
>>> *Invalid library found in
>>> C:\Users\gerbyrne\Documents\Arduino\libraries\blink: no headers
>>> files (.h) found in
>>> C:\Users\gerbyrne\Documents\Arduino\libraries\blink*
>>> *Invalid library found in
>>> C:\Users\gerbyrne\Documents\Arduino\libraries\blink: no headers
>>> files (.h) found in
>>> C:\Users\gerbyrne\Documents\Arduino\libraries\blink*
>>> --
>>> *Copernicus*
>>>
>>
>>
>>
>
>
>




--
Copernicus


Gerry Byrne
 

Drew,
Good suggestion. I'll work on that too tomorrow.
Gdrry

On Wed 15 Jul 2020, 22:12 Drew 🔭📷🚴‍♂️, <drewbolce@...> wrote:
On Wed, Jul 15, 2020 at 03:41 PM, Dave Schwartz wrote:
I'm going to assume that the COM port you are selecting in the IDE is the one that appears when you connect the CP2102.
A quick test to be sure something Arduino is on the selected COM port is to press the "Get Board info" selection under the Port. You can ignore the information itself, only a live port will open up the info box. No info box, you have the wrong port.


--
Copernicus


Gerry Byrne
 

Dave,
A photo of the Com Port flyout shows only Com 3 and it already has a tick beside it. I selected it by clicking on it but nothing happened. I still get failure to initialise. When I track back through Device Manager CP2101 has also been allocated Com 3 by Windows. BTW can you read through the other items on the photo. Am I using the correct updater? Is that WiFi101/ WiFiNINA Updater correct?

There was a positive change when I removed the switch harness. The green LED stopped flashing. But I still get failure to initialise. I attach photo - have I done this correctly to achieve flash mode?

I think I will now attempt to rebuild the Onstep sketch as Drew suggested through a fresh install of Arduino and the Onstep elements and hopefully get rid of the Blink stuff. Although I would have imagined the sketch transfer would have initialised in any event once contact was made with the appropriate port.
Gerry

On 15/07/2020 20:41, Dave Schwartz wrote:
I'm going to assume that the COM port you are selecting in the IDE is the one that appears when you connect the CP2102. Are you actually selecting that from the 'Port' flyout ? Your picture doesn't show a port as being selected. You have to actually select it, its not good enough that it just be in the flyout list.

Let's eliminate that wiring harness to the flash-run switch. Go back to using the original jumper. The existing yellow jumper on BOOT1 is where it always stays, bridging the center and '0' end pins. Put the one on the BOOT0 header... the same end as BOOT1 is the run position and the opposite (bridging the center and '1') end pins is the flash position. I believe the green LED should not be active when in flash mode because not even the original blink sketch will be running in that mode.

On 2020-07-15 11:40 a.m., Gerry Byrne wrote:
Dave,
Yes, it's a brand new replacement STM32 and it flashed from the get-go, before I attempted to upload anything to it.

I think you may have a point about the blink sketch (Drew makes a similar point). I never realised Arduino behaved like that. But would that completely explain the failure to initialise?

Since writing earlier I did a circuit test on links between the CP2102 and the STM board. One pin on the CP2102 appeared slightly loose with an intermittent circuit  between it and A10 on the Blue Pill and I re-soldered it and the connection is now perfect between RX, Tx and A9 and A10.. But still I cannot upload.

Here, in excruciating detail, is what I have been doing.

I unplug everything. Move the switch to flash. Power up via the 5V supply on the PCB. Red LED lights, Green LED flashes.  Then plug USB from the laptop to the CP2102. Instruct the IDE to upload the Onstep sketch. It compiles and then goes into upload mode. It says "done uploading" but inspection reveals the "failed to init device" message again along with the other stuff about blink. I repeat by depowering, unplugging the USB and repowering and reinserting the USB plug followed by another attempt at uploading.

My board settings are as in the attached photo. COM Port is not shown but it is COM 3 and this is confirmed by Device Settings. When I changed it to COM 2, the IDE went looking for COM 3 and I changed it back.

I attach other pics attempting to show the switch connections to the Blue Pill.

Many thanks for your interest.
Gerry









On 15/07/2020 15:05, Dave Schwartz wrote:
Is the flashing green LED the behavior of the STM32 before you have uploaded anything to it? If so, that is normal because there is a default blink program uploaded to it as a test step during fabrication. All the ones I have had did that.

I have no idea what the 'Invalid library' could be... not the foggiest idea why something would be trying to access something from the blink sketch an during OnStep build unless you have somehow corrupted the OnStep directory with blink sketch code. A complete wipe of the OnStep directory and refresh from the repository might be needed.

Please describe, in excruciating detail, the steps you are performing when preparing the STM32 for the upload and restoring it to run mode. Perhaps include detailed descriptions or a picture of how the flash/run switch is connected to the header on the STM32 (or the configuration of the jumpers if you are not using the switch). This has been conquered by literally hundreds of people so there must be something in the sequence that you are doing that is incorrect but you don't recognize it because you've never seen it work successfully. Nothing worse than having a procedure wrong and doing it over and over expecting a different result because you haven't realized a tiny error. Been there, done that.

On 2020-07-15 8:24 a.m., Gerry Byrne wrote:
I continue to receive the following error messages (see below this message) when attempting to flash the STM32 with Onstep.

I have reloaded all the appropriate software libraries, etc, and the sketch compiles  without problems. Uploading is the problem.

I have replaced both the STM32 Blue Pill and the CP2102 to no avail. My laptop now recognises the CP2102 and has allocated it to Com 3 (previously I got a "device is faulty" message). It flashes red about four times when the USB is connected then remains a steady red.

The new STM32 Blue Pill has a power light (red) on when the PCB power supply (5V) is connected. However it also has a rapid flashing green LED. Is this normal?

Gerry Byrne

Error Message:

*Failed to init device *
*stm32flash 0.4*
*http://stm32flash.googlecode.com/*
*Using Parser : Raw BINARY*
*Interface serial_w32: 115200 8E1*
*Invalid library found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink: no headers files (.h) found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink*
*Invalid library found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink: no headers files (.h) found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink*
--
*Copernicus*


--
*Copernicus*


Khalid Baheyeldin
 

On Thu, Jul 16, 2020 at 12:25 PM, Gerry Byrne wrote:

There was a positive change when I removed the switch harness. The green LED stopped flashing. But I still get failure to initialise. I attach photo - have I done this correctly to achieve flash mode?
Whatever is in the photo, with the black jumper connected the left pin with the center pin, means that the STM32 is in flash mode.
Provided you can get the USB port recognized in Windows, you should be able to flash the STM32.

Then after you do so, you should switch the jumper to the right pin and the center pin. Then if you power cycle, OnStep should start.


Drew 🔭📷🚴‍♂️
 

On Thu, Jul 16, 2020 at 12:25 PM, Gerry Byrne wrote:
When I track back through Device Manager CP2101 has also been allocated Com 3 by Windows.
Did you do the "Get Board Info" as I suggested? This will tell you that the Arduino IDE sees the board on that port. That is what you need to know.

I suggested you recreate the OnStep directory. It may not be necessary to rebuild the Arduino IDE. As a matter of fact  I would suggest you do not, saving that step as a last resort.


Dave Schwartz
 

Yes that is correct. It is in flash mode and you have the port selected  now. There must be something wrong with that three-wire harness or the switch. The switch and harness is only there so that you can place it in flash mode without opening the case and moving the jumper (the switch bat is supposed to be accessible through a slot in the case). Getting it to work that way is something to figure out later.

That 'WiFi101/ WiFiNINA' is not used (nor is 'Programmer ArduinoISP') due to our board manager selection overrides.

You are now much closer - hang in there!

On 2020-07-16 12:21 p.m., Gerry Byrne wrote:
Dave,
A photo of the Com Port flyout shows only Com 3 and it already has a tick beside it. I selected it by clicking on it but nothing happened. I still get failure to initialise. When I track back through Device Manager CP2101 has also been allocated Com 3 by Windows. BTW can you read through the other items on the photo. Am I using the correct updater? Is that WiFi101/ WiFiNINA Updater correct?

There was a positive change when I removed the switch harness. The green LED stopped flashing. But I still get failure to initialise. I attach photo - have I done this correctly to achieve flash mode?

I think I will now attempt to rebuild the Onstep sketch as Drew suggested through a fresh install of Arduino and the Onstep elements and hopefully get rid of the Blink stuff. Although I would have imagined the sketch transfer would have initialised in any event once contact was made with the appropriate port.
Gerry



On 15/07/2020 20:41, Dave Schwartz wrote:
I'm going to assume that the COM port you are selecting in the IDE is the one that appears when you connect the CP2102. Are you actually selecting that from the 'Port' flyout ? Your picture doesn't show a port as being selected. You have to actually select it, its not good enough that it just be in the flyout list.

Let's eliminate that wiring harness to the flash-run switch. Go back to using the original jumper. The existing yellow jumper on BOOT1 is where it always stays, bridging the center and '0' end pins. Put the one on the BOOT0 header... the same end as BOOT1 is the run position and the opposite (bridging the center and '1') end pins is the flash position. I believe the green LED should not be active when in flash mode because not even the original blink sketch will be running in that mode.

On 2020-07-15 11:40 a.m., Gerry Byrne wrote:
Dave,
Yes, it's a brand new replacement STM32 and it flashed from the get-go, before I attempted to upload anything to it.

I think you may have a point about the blink sketch (Drew makes a similar point). I never realised Arduino behaved like that. But would that completely explain the failure to initialise?

Since writing earlier I did a circuit test on links between the CP2102 and the STM board. One pin on the CP2102 appeared slightly loose with an intermittent circuit  between it and A10 on the Blue Pill and I re-soldered it and the connection is now perfect between RX, Tx and A9 and A10.. But still I cannot upload.

Here, in excruciating detail, is what I have been doing.

I unplug everything. Move the switch to flash. Power up via the 5V supply on the PCB. Red LED lights, Green LED flashes. Then plug USB from the laptop to the CP2102. Instruct the IDE to upload the Onstep sketch. It compiles and then goes into upload mode. It says "done uploading" but inspection reveals the "failed to init device" message again along with the other stuff about blink. I repeat by depowering, unplugging the USB and repowering and reinserting the USB plug followed by another attempt at uploading.

My board settings are as in the attached photo. COM Port is not shown but it is COM 3 and this is confirmed by Device Settings. When I changed it to COM 2, the IDE went looking for COM 3 and I changed it back.

I attach other pics attempting to show the switch connections to the Blue Pill.

Many thanks for your interest.
Gerry









On 15/07/2020 15:05, Dave Schwartz wrote:
Is the flashing green LED the behavior of the STM32 before you have uploaded anything to it? If so, that is normal because there is a default blink program uploaded to it as a test step during fabrication. All the ones I have had did that.

I have no idea what the 'Invalid library' could be... not the foggiest idea why something would be trying to access something from the blink sketch an during OnStep build unless you have somehow corrupted the OnStep directory with blink sketch code. A complete wipe of the OnStep directory and refresh from the repository might be needed.

Please describe, in excruciating detail, the steps you are performing when preparing the STM32 for the upload and restoring it to run mode. Perhaps include detailed descriptions or a picture of how the flash/run switch is connected to the header on the STM32 (or the configuration of the jumpers if you are not using the switch). This has been conquered by literally hundreds of people so there must be something in the sequence that you are doing that is incorrect but you don't recognize it because you've never seen it work successfully. Nothing worse than having a procedure wrong and doing it over and over expecting a different result because you haven't realized a tiny error. Been there, done that.

On 2020-07-15 8:24 a.m., Gerry Byrne wrote:
I continue to receive the following error messages (see below this message) when attempting to flash the STM32 with Onstep.

I have reloaded all the appropriate software libraries, etc, and the sketch compiles  without problems. Uploading is the problem.

I have replaced both the STM32 Blue Pill and the CP2102 to no avail. My laptop now recognises the CP2102 and has allocated it to Com 3 (previously I got a "device is faulty" message). It flashes red about four times when the USB is connected then remains a steady red.

The new STM32 Blue Pill has a power light (red) on when the PCB power supply (5V) is connected. However it also has a rapid flashing green LED. Is this normal?

Gerry Byrne

Error Message:

*Failed to init device *
*stm32flash 0.4*
*http://stm32flash.googlecode.com/*
*Using Parser : Raw BINARY*
*Interface serial_w32: 115200 8E1*
*Invalid library found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink: no headers files (.h) found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink*
*Invalid library found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink: no headers files (.h) found in C:\Users\gerbyrne\Documents\Arduino\libraries\blink*
--
*Copernicus*





Gerry Byrne
 

Drew,
The box in my photo (see Pic1) comes up when I select "Get Board Info" (the board is powered up, in RUN mode and the USB is connected).
BN: Unknown Board
VID: lOC4
PID: EA60
SN: Upload any sketch to obtain it

I also notice (see Pic2) that other information comes up at the very bottom of the screen. It reads:
Generic STM32F103C series, STM32F103CB (20k RAM. 128k Flash), serial, 72 Mhz (normal), Smallest (default) on COM3.

Apart3 from this line, which appears to be a report of parameters entered in Tools, there is no mention of any Com port.
Gerry



On 16/07/2020 17:52, Drew 🔭📷🚴 ♂ wrote:
On Thu, Jul 16, 2020 at 12:25 PM, Gerry Byrne wrote:
When I track back through Device Manager CP2101 has also been allocated Com 3 by Windows.
Did you do the "Get Board Info" as I suggested? This will tell you that the Arduino IDE sees the board on that port. That is what you need to know.

I suggested you recreate the OnStep directory. It may not be necessary to rebuild the Arduino IDE. As a matter of fact  I would suggest you do not, saving that step as a last resort.


--
Copernicus


Khalid Baheyeldin
 

On Thu, Jul 16, 2020 at 06:52 PM, Gerry Byrne wrote:
when I select "Get Board Info" (the board is powered up, in RUN mode and the USB is connected).
What Drew meant is that you need to do this with the jumper/cable/switch in the FLASH position.
That tells us whether the IDE sees the STM32 as ready for flashing or not.


Gerry Byrne
 

Khalid,
I get exactly the same as it Pic1 earlier. The little box saying unknown board comes up.
Gerry

On 16/07/2020 23:56, Khalid Baheyeldin wrote:
On Thu, Jul 16, 2020 at 06:52 PM, Gerry Byrne wrote:
when I select "Get Board Info" (the board is powered up, in RUN mode and the USB is connected).
What Drew meant is that you need to do this with the jumper/cable/switch in the FLASH position.
That tells us whether the IDE sees the STM32 as ready for flashing or not.


--
Copernicus


Drew 🔭📷🚴‍♂️
 

On Thu, Jul 16, 2020 at 07:23 PM, Gerry Byrne wrote:
get exactly the same as it Pic1 earlier. The little box saying unknown board comes up.

Yes , that is what we want. The contents are immaterial, its presence tells us that the Arduino IDE is talking  to the chip. The bottom line is just showing you the hardware device that you selected. Change the device and it will change to match your selection.


Gerry Byrne
 

Guys,
 I'm at a loss what to try next, apart from re-building the Onstep software.

I think I would like to eliminate potential technical problems first. For example, see the pictures of the Properties of my CP2101. I re-installed the drivers (again) and, even though properties (via Device Manager)  says the device is working perfectly (Pic1), looking under other headings appears to tell a different story.

(Pic2) Events tells me the device needs further installation and scrolling through the history here shows several instances of "device not migrated". (I re-installed this driver several times).

(Pic3) shows I have adjusted the Transmit and Receive settings downwards in an effort to achieve connection, to no avail. Is the FIFO setting correct? Under Power Management (no picture) the setting for turning this device off to save power remains unticked.

You guys are being really patient with me. I appreciate that very much.
Gerry






On 17/07/2020 00:54, Drew 🔭📷🚴 ♂ wrote:
On Thu, Jul 16, 2020 at 07:23 PM, Gerry Byrne wrote:
get exactly the same as it Pic1 earlier. The little box saying unknown board comes up.

Yes , that is what we want. The contents are immaterial, its presence tells us that the Arduino IDE is talking  to the chip. The bottom line is just showing you the hardware device that you selected. Change the device and it will change to match your selection.


--
Copernicus


Drew 🔭📷🚴‍♂️
 

Redoing the OnStep directory is the first thing you should have done. Save your Config.ino file in a safe place and delete the OnStep directory. Download and unzip the latest OnStep Master and install it to the Arduino directory. Rename the directory to OnStep and copy your saved Config.ino over the existing one. That is all you should need to do.

There are several versions of the CP210x driver out there. Please do  a screen shot of the driver tab. There are some issues with specific chips and driver versions.

You should not ever need to fool around with the speed settings, restore them  to default. The driver migration message and the incomplete installation messages may or may not be part of the problem. Often with Windows 10 these errors just indicate problems with the driver writers following Windows 10 code methods and the drivers are fine.

Do the above, we are getting there.


Gerry Byrne
 

Drew,
Thanks, I'll get down to that now. BTW, if I have time I was also going to install Arduino and Onstep on an old Laptop and try flashing from that as a way of eliminating hardware problems in my newer (or should I say, less old!) laptop. Will that combo work on Windows XP?
Gerry

On 17/07/2020 13:18, Drew 🔭📷🚴 ♂ wrote:
Redoing the OnStep directory is the first thing you should have done. Save your Config.ino file in a safe place and delete the OnStep directory. Download and unzip the latest OnStep Master and install it to the Arduino directory. Rename the directory to OnStep and copy your saved Config.ino over the existing one. That is all you should need to do.

There are several versions of the CP210x driver out there. Please do  a screen shot of the driver tab. There are some issues with specific chips and driver versions.

You should not ever need to fool around with the speed settings, restore them  to default. The driver migration message and the incomplete installation messages may or may not be part of the problem. Often with Windows 10 these errors just indicate problems with the driver writers following Windows 10 code methods and the drivers are fine.

Do the above, we are getting there.


--
Copernicus


Drew 🔭📷🚴‍♂️
 

BTW, the file is config.h not config.ino. Brain fart.

I wouldn't do any of that. I don't think you need to reinstall the Adduino IDE just yet. It is very time consuming and probably not the problem. Going back to Windows XP is not advised, ever with this hardware or software.