Notifications
Clear all

Uploading protocol

34 Posts
5 Users
4 Likes
297 Views
barrie
(@barrie)
Trusted Member
Joined: 3 months ago
Posts: 86
Topic starter  

My debugging process involves many uploads and I want to be sure that Anuino Nano memory is completely cleaned out during downloading new code.

Should I flush the memory before each upload? If so, how? 

This topic was modified 3 months ago by barrie

   
Quote
Will
 Will
(@will)
Famed Member
Joined: 1 year ago
Posts: 2140
 

@barrie

Uploading the new sketch is quite sufficient all by itself.

Experience is what you get when you don't get what you want.


   
ReplyQuote
barrie
(@barrie)
Trusted Member
Joined: 3 months ago
Posts: 86
Topic starter  

@will Thank you. That eliminates one suspect.


   
ReplyQuote
Will
 Will
(@will)
Famed Member
Joined: 1 year ago
Posts: 2140
 

@barrie 

Uh oh ... that sounds ominous. What's happening ?

Experience is what you get when you don't get what you want.


   
DaveE reacted
ReplyQuote
DaveE
(@davee)
Prominent Member
Joined: 2 years ago
Posts: 714
 

Hi @barrie,

   I agree with @will's answer with regard to memory holding program code ... merely downloading the revised program code is normally fine, and I would just use it.

---------

The only suggestion I would add ... the term 'memory' in context of microcontrollers can refer to many different types and places, depending upon what you are doing, not just the program memory. Even so, "999 times out of 1000" the download process will reset everything without a problem.

But occasionally, a single 'bit' of memory, which might be a (say) a flipflop in the processor can end up in an unexpected state ... and it may stay in that state until the power is removed.

Hence, if things are playing strangely, then one of the simplest 'debug' things to try, is turn off the power for a couple of seconds, and then try again.

In most cases, it makes no difference, and you still have to find the 'real' problem, but it is a simple trick to eliminate a possibility.

Best wishes, Dave


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3462
 

@davee And what about stray radiation?

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
barrie
(@barrie)
Trusted Member
Joined: 3 months ago
Posts: 86
Topic starter  

Well! Dare I say it. Almost time to Celebrate. After a bug ridden day I finally got my small kinetic art display to perform by proximity of the observer. I now have to tweek the manoeuvres. The next phase is to add complementary LED lights. All with a loveable little nano.


   
DaveE reacted
ReplyQuote
DaveE
(@davee)
Prominent Member
Joined: 2 years ago
Posts: 714
 

Hi Ron @zander,

  I am not sure what you mean by 'stray radiation'

  If you referring to the effect of ionising radiation/particles, then this is one of the possible reasons why  my power down suggestion is appropriate.

To briefly explain:

   One of the causes of a 'memory' content to be corrupted (e.g. a zero becomes one or vice versa) can be the result of cosmic ray or emission from a radioactive decay. It can also cause a thyristor-style latch up to occur with similar consequences.

In some cases, this can result in the device being permanently damaged, but commonly it just results in a corruption which can be 'fixed' by cycling the power.

Hope this helps. Best wishes, Dave


   
ReplyQuote
Will
 Will
(@will)
Famed Member
Joined: 1 year ago
Posts: 2140
 

@barrie 

If you still have room after that you could add some memory and an MP3 player too.

Experience is what you get when you don't get what you want.


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3462
 

@davee Yep, that's it.

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
barrie
(@barrie)
Trusted Member
Joined: 3 months ago
Posts: 86
Topic starter  

@will Crikey, what a great idea. it would be easy to put sound effects on a chip recorder and synchronise it with the movements. How do you check remaining Eprom memory? 


   
ReplyQuote
Will
 Will
(@will)
Famed Member
Joined: 1 year ago
Posts: 2140
 
Posted by: @barrie

@will Crikey, what a great idea. it would be easy to put sound effects on a chip recorder and synchronise it with the movements. How do you check remaining Eprom memory? 

Since you're just starting out, it may be easier for you to use an SD card to store the music. You can find whatever music, voice or sound effect files and just store them on the card.

There's a project on the Arduino project hub which should help you work your way through the process and help you decide if it's worth the extra trouble 🙂

https://create.arduino.cc/projecthub/ronfrtek/arduino-mp3-player-07ad15

 

Experience is what you get when you don't get what you want.


   
ReplyQuote
Inq
 Inq
(@inq)
Noble Member
Joined: 8 months ago
Posts: 966
 
Posted by: @barrie

Well! Dare I say it. Almost time to Celebrate. After a bug ridden day I finally got my small kinetic art display to perform by proximity of the observer. I now have to tweek the manoeuvres. The next phase is to add complementary LED lights. All with a loveable little nano.

Do we get to see a video???

My Library Makers Group is doing a pair of animatronic eyes and one member is working with a pair of HC-SR04 sensors working in triangulation so the eyes follow the observer.  Sounds like similar problems had to be conquered.  

VBR,

Inq

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, Access Point Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
barrie
(@barrie)
Trusted Member
Joined: 3 months ago
Posts: 86
Topic starter  

@will Thanks for that link. It was very interesting. It got me buzzed with an overflow of ideas.

By the way I have an interesting bug. I multiplied a float by an integer and got a silly answer. 

do all numbers have to be the same type? OR is it something else?


   
ReplyQuote
Inq
 Inq
(@inq)
Noble Member
Joined: 8 months ago
Posts: 966
 
Posted by: @barrie

By the way I have an interesting bug. I multiplied a float by an integer and got a silly answer. 

do all numbers have to be the same type? OR is it something else?

No, it should have converted the integer to a float and then do multiplication, unless you have some odd type casting going on.  Show us the full equation and identify what variable types are in it.

BUT... what is the variable type you're placing the answer in?  That might give you some interesting (bizarre) results.

3 lines of code = InqPortal = Complete IoT, App, Web Server w/ GUI Admin Client, Access Point Manager, Drag & Drop File Manager, OTA, Performance Metrics, Web Socket Comms, Easy App API, All running on ESP8266...
Even usable on ESP-01S - Quickest Start Guide


   
ReplyQuote
Page 1 / 3