Skip to content

Bootloader burns just fine, uploaded simple program is not working #174

@yeayer

Description

@yeayer

``Hello, I am trying to get ATmega4809 on Arduino Nano Every working with serial programmer. Thing I have done:

  1. Removed level shifting transistors that connected SAMD11 used as UPDI programmer to Atmega4809, also removed pullup R on UPDI
  2. Created a working programmer from Arduino Nano with Atmega328P
  3. Burned bootloader Optiboot with serial3 on alternative pins (to match the Every Nano so I can use the PCB traces)

So my issue is - I can burn bootloader via Arduino Nano to the ATmega4809. When I dump the memory to a file, it is exactly what the bootloader hex from your code looks like. When I try uploading through serial (FT231X connected to mega4809 on Serial3 alt pins), it uploads just fine, reads just fine but the code simply does not run. I checked the fuses, dumped the hex (bootloader is still here, tried to upload also with no bootloader, whatever...). When I tried a sketch as simple as this:

`#include <Arduino.h>
bool test;
void setup()
{
pinMode(5,OUTPUT);
}

void loop()
{
delay(500);
test = !test;
digitalWrite(5,test);
}`

, it simply will not do anything. Tried using serialPrint, SSD1306 display, also nothing. Also I tried uploading with PlatformIO on VScode, it deletes the bootloader but the sketch gets uploaded, also does not work. When I purposefully "messed" the pin operations up in the code, on some versions the LED lit up with a very low current (I guess something got really wrong). Is there anything I forgot? I tried also not using the Arduino pinMode and digitalWrite functions, I just set the registers directly, with also no luck. Is there anything I am forgetting from the HW point? Do I need to add some resistors, etc? It drives me crazy as I have already written a long code that works on Nano Every, but I want to use my own boards and I do not want another chip (SAMD11) here. Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions