Hi, i hope you give me a hand on this.
what i want to do is, read flash --> disassemble hex file ---> modify Asm file --> generate hex file --> upload it to the microcontroller(Arduino uno=atmega328p)
im using the blink sketch for testing. i would like to modify the delay.
Im reading hex file with Avrdude, i have no problem doing this.(why it fills the file with .byte 1 to complete the space left ? IDA also does this)
im using atmel studio to compile the asm file and generate the final hex file.
i have used different options to disassemble the hex file.
1. IDA PRO
of course i got some compiling errors, for example
undefined symbols errors, i just check in the other disassemble asm files to correct them.
lds r24, unk_100101 ---- > lds r24, 0x0101
call nullsub_1 ---- > call avr01F0 (i createed this macro according to another asm file)
etc... at the end , i build the project with no errors, and upload it to the arduino, but it doesnt work, led keeps on for ever.
2. AVR-OBJDUMP
here i got errors like this:
syntax error, unexpected $undefined
rjmp .-44 -- > rjmp PC -4 ( i read somewhere in this forum is becase different versions of disassembler)
rjmp .+4 ---> rjmp PC+4
Relative branch out of reach
breq PC+82 ----> breq avr01B7(i also created this macro avr01B7) (avr01B7: pop YH ; 01B7 91DF)
i build no error, but it doesnt work, led keeps on.
3.DISAVR
in r18, ?0x26? ---->in r18, 0x26
movw r14 r24 ----> movw r14, r24
in r24, ICR1L ---> in r24, 0x24 (i saw this in avr-objdmp asm file)
rjmp $ ---> rjmp PC-2
also had to change in by lds or out by sts im some cases.
but i got the same result.
i havent even modify the asm file to make a longer delay, and its not even working.
what could be the problem ?
THANKS!!