Replacement for reset button

Hi,

My board is Arduino Due

I use attribute ((section (".noinit"))); to get the non-initial memory value

Here is my code

char bytes[ 16 ] __attribute__ ((section (".noinit")));

void setup() {
  Serial.begin( 9600 );
  for( int i = 0 ; i < 16 ; ++i ) ItemOut( i, bytes[ i ] );
}

void ItemOut( int i, char el ){
  Serial.print( ( unsigned int ) el, HEX );
  if( i % 16 == 15) Serial.println( ',' );
  else Serial.print( ',' );
}

void loop() {}

output:

When I press the reset button on the board, the program would rerun and reset the memory value

I want to know is there any software solution to replace the reset button to rerun the program ?

I already try using the reset pin and watchdog but non of them can rerun the whole program and just print out the same value

Thanks!

I use attribute ((section (".noinit")));

What exactly is your reason for doing this ?

is there any software solution to replace the reset button to rerun the program ?

Why exactly do you want to do this ?

UKHeliBob:
What exactly is your reason for doing this ?

Why exactly do you want to do this ?

I need to extract the non-initial value of the on-chip SRAM to simulate SRAM PUF

Hi,
Welcome to the forum.

If you want to run your program again and again, put it in the void loop{} part of the code not the void setup{}.

What are you trying to do with your code?

Can you please tell us your electronics, programming, arduino, hardware experience?

Tom.. :slight_smile:

TomGeorge:
Hi,
Welcome to the forum.

If you want to run your program again and again, put it in the void loop{} part of the code not the void setup{}.

What are you trying to do with your code?

Can you please tell us your electronics, programming, arduino, hardware experience?

Tom.. :slight_smile:

Thanks for your reply!

however, for attribute ((section (".noinit")));
It stop initializing the memory to zero at the beginning, so this line should be the first line of my program

As a result, it cannot be placed in the loop{}

That's the reason why I need to use reset button to rerun the program

Hi,
Can you please tell us your electronics, programming, arduino, hardware experience?

What are you trying to do with your code and why?

Tom... :slight_smile:

Hi,

I want to extract the initial value of the SRAM to simulate the Arduino as a SRAM PUF, which is a physical

characteristic of each chip. To put it simply, the SRAM initial value can be seen as the identity of a chip.

char bytes[ 16 ] __attribute__ ((section (".noinit")));  // stop initial the SRAM to zero 
//and save 16 memory value to array bytes  

void setup() {
  Serial.begin( 9600 );
  for( int i = 0 ; i < 16 ; ++i ) ItemOut( i, bytes[ i ] );   //print out the memory value
}

void ItemOut( int i, char el ){
  Serial.print( ( unsigned int ) el, HEX );
  if( i % 16 == 15) Serial.println( ',' );
  else Serial.print( ',' );
}

void loop() {}

For my experiment, I need a massive amount of SRAM value (about 1,000 value) to experiment and analysis its stability and randomness and do some further more application.

The simplest and stupidest way is to unplug and plug the board for 1,000 times.

The other way is press the reset button of the board, which also clean the SRAM and start over the program

(like it power off and power on the board, but the LED light is still shining so I think the board is not really been powered off)

However, pressing the reset button for over 1,000 times still not clever enough, so I want to know if there any

solution to write the function of the reset button into my program to automate the whole process.

I already try these two reset method:

1.software reset as this link:

2.watchdog timer

However, non of them performed as pressing the reset button.
The SRAM didn’t be clean off and restart.

Thanks!

I am not clear whether you need the SRAM contents to be consistently the same following a reset or not but, of course, if the Arduino is powered off then the previous contents will be lost anyway.

If you really, really want to press the reset button 1000 times then why not wire a relay or MOSFET driven from a second Arduino across the reset button pins

UKHeliBob:
I am not clear whether you need the SRAM contents to be consistently the same following a reset or not but, of course, if the Arduino is powered off then the previous contents will be lost anyway.

If you really, really want to press the reset button 1000 times then why not wire a relay or MOSFET driven from a second Arduino across the reset button pins

I used another Arduino to control the reset pin and success!

Thanks a lot!

ttc163:
I used another Arduino to control the reset pin and success!

Thanks a lot!

Another solution is to define any pin on your arduino as rest pin and connect a wire to from this pin to the other pin on same arduini which is already named as reset and when you need to reset your code set a duration to then pin you just declared as reset to be LOW when such duration is over pin will be low and it will send a low signal via wire to other reset pin hence your code resets. Advantage is that you do not need another arduino. I have tested in my project.