Arduino Pro Mini - 328p - Optiboot hex not working

Quote from PSOR on November 18, 2024, 12:40 pmHello,
SimulIDE 1.1.0-SR1
I have a problem with starting the simulation of MPe v6 (optiboot bootloader) to ebike (bikel.pl) with ready ..hex file
Arduino Pro Mini ATmega 328P 16Mhz 5V
Soft version V5 starts without any problem.
Arduino Bootloader:
1. MPeV5_5014_init.hex << Load first, set EEprom, Display show: InitOK , after reset - LoadOK
2. MPeV5_5014_MitarBT.hex
The V6 not starting. ( All files V6 )
V6 - not need RTC
V6 uses Optiboot Bootloader.
1. MPeV6_6010_init_3000W.hex ... Like V5 ... but nothing hapend..
2. MPeV6_6010.hex
in zip attachment - files and project
Please help me.
Greetings , Peter.
Hello,
SimulIDE 1.1.0-SR1
I have a problem with starting the simulation of MPe v6 (optiboot bootloader) to ebike (bikel.pl) with ready ..hex file
Arduino Pro Mini ATmega 328P 16Mhz 5V
Soft version V5 starts without any problem.
Arduino Bootloader:
1. MPeV5_5014_init.hex << Load first, set EEprom, Display show: InitOK , after reset - LoadOK
2. MPeV5_5014_MitarBT.hex
The V6 not starting. ( All files V6 )
V6 - not need RTC
V6 uses Optiboot Bootloader.
1. MPeV6_6010_init_3000W.hex ... Like V5 ... but nothing hapend..
2. MPeV6_6010.hex
in zip attachment - files and project
Please help me.
Greetings , Peter.

Quote from arcachofo on November 18, 2024, 11:20 pmHi.
Can you describe exactly what is the problem?
And I know nothing about this circuit, what it does and how it should work.
There are also 2 MCUs and a lot on hex files.
I have no idea what to do with the files you sent.
Hi.
Can you describe exactly what is the problem?
And I know nothing about this circuit, what it does and how it should work.
There are also 2 MCUs and a lot on hex files.
I have no idea what to do with the files you sent.

Quote from PSOR on November 19, 2024, 10:14 amHi.
The project is on Arduino Pro Micro (without USB/RS)
MPeV5_5014_init.hex < Load to MCU - Initialize EEPROM settings,
run simulation - Screen show INIT OK, one time power restart ..
and after that we need load to MCU main program MPeV5_5014_MitarBT.hex
V5 Init + Main Program Work OK
I put two MCU to check if V6 runs on the Atmega 328 processor , I know a little bit messed with it
NOW V6 ... procedure is identical
Load to MCU > MPeV6_6010_init_3000W.hex - not starting -nothing hapend , like program was stoped.
I upload to the real Arduino - the program works, in the simulator not
Hi.
The project is on Arduino Pro Micro (without USB/RS)
MPeV5_5014_init.hex < Load to MCU - Initialize EEPROM settings,
run simulation - Screen show INIT OK, one time power restart ..
and after that we need load to MCU main program MPeV5_5014_MitarBT.hex
V5 Init + Main Program Work OK
I put two MCU to check if V6 runs on the Atmega 328 processor , I know a little bit messed with it
NOW V6 ... procedure is identical
Load to MCU > MPeV6_6010_init_3000W.hex - not starting -nothing hapend , like program was stoped.
I upload to the real Arduino - the program works, in the simulator not


Quote from PSOR on November 19, 2024, 10:06 pmHello I tested v6 on a real Arduino nano and v6 did not want to be loaded... the reason was the bootloader, I used hex optiboot atmega328, it works
Optibot Github : https://github.com/Optiboot/optiboot/tree/master/optiboot/bootloaders/optiboot
Hello I tested v6 on a real Arduino nano and v6 did not want to be loaded... the reason was the bootloader, I used hex optiboot atmega328, it works
Optibot Github : https://github.com/Optiboot/optiboot/tree/master/optiboot/bootloaders/optiboot
Uploaded files:
Quote from PSOR on November 20, 2024, 12:45 pmmega328.mcu:
mcu name="mega328" core="AVR" data="2304" prog="16384" progword="2" eeprom="1024"
inst_cycle="1" freq="16000000"
---
Optiboot boards.txt
atmega328o.upload.maximum_size=32256
I understand that this Hex needs to work with optiboot bootloader there is probably a different program start vector.
..file at the beginning of the post ..
Can I change something here to make Hex start in the simulator?
mega328.mcu:
mcu name="mega328" core="AVR" data="2304" prog="16384" progword="2" eeprom="1024"
inst_cycle="1" freq="16000000"
---
Optiboot boards.txt
atmega328o.upload.maximum_size=32256
I understand that this Hex needs to work with optiboot bootloader there is probably a different program start vector.
..file at the beginning of the post ..
Can I change something here to make Hex start in the simulator?


Quote from PSOR on November 21, 2024, 10:50 amQuote from arcachofo on November 21, 2024, 10:41 amOk, that must be the problem.
By now there is no support for bootloader in Simulide.What about a bare 328p processor, what if I put the bootloader + program into one hex file and it would run it?
How do you emulate the processor and run the program? , is it some bootloader emulator or do you start the program from the beginning?
Quote from arcachofo on November 21, 2024, 10:41 amOk, that must be the problem.
By now there is no support for bootloader in Simulide.
What about a bare 328p processor, what if I put the bootloader + program into one hex file and it would run it?
How do you emulate the processor and run the program? , is it some bootloader emulator or do you start the program from the beginning?

Quote from arcachofo on November 21, 2024, 10:53 amWhat about a bare 328p processor, what if I put the bootloader + program into one hex file and it would run it?
The problem is that to run the bootloader you need to configure a fuse that makes the reset vector to jump to the bootloader.
This is not implemented in Simulide.
How do you emulate the processor and run the program? , is it some bootloader emulator or do you start the program from the beginning?
The program starts normally, executing instructions at address 0.
What about a bare 328p processor, what if I put the bootloader + program into one hex file and it would run it?
The problem is that to run the bootloader you need to configure a fuse that makes the reset vector to jump to the bootloader.
This is not implemented in Simulide.
How do you emulate the processor and run the program? , is it some bootloader emulator or do you start the program from the beginning?
The program starts normally, executing instructions at address 0.

Quote from PSOR on November 21, 2024, 2:12 pm- SOLVED -
I merged the program's hex files and finally inserted the bootloader without line BEFORE the last line of code.
It works
The simulator is GREAT, great job
- SOLVED -
I merged the program's hex files and finally inserted the bootloader without line BEFORE the last line of code.
It works
The simulator is GREAT, great job