Git Product home page Git Product logo

bare-metal-sam3x's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bare-metal-sam3x's Issues

Watchdog enabled on power on

According to the datasheet the watchdog timer is enabled by default after a power-on reset. It's set to ~ 16 seconds after which it will reset the board (section 15.4 on page 261). If you're just blinking an LED like in this example especially with a long period then you are unlikely to notice it fire and reset the board. I spent an hour debugging my own bare metal program trying to figure out why it was resetting at such a consistent uptime before I figured this out. You can disable it on boot with:

static uint32_t* const WDT_MR = (uint32_t*) 0x400E1A54;

void main() {
  // watchdog timer is actived on boot with a default timeout so disable it
  // note: you can only write to WDT_MR once after power on reset
  // Atmel SAM3X8E Datasheet, section 15.4, page 261
  *WDT_MR |= (1 << 15); // WDDIS (watchdog disable) bit, page 265

  // ... omitted ...
}

Hopefully this helps the next person who comes along and tries to use this project as a starting point from having to debug the same issue.

bossac

For programming my Due with a Raspberry Pi I reset it with
stty -F /dev/ttyACM0 1200

Then I can flash it with bossac.

Bossac Version

Just wanted to let you know that only version 1.7 of bossac will work to flash the Arduino Due. Since 1.8 was released not only older versions won't work, even the newer version seems to be broken for this device.

Btw i want to thank you for the hint with the version issue. I was trying to get the Due running with minimal bare metal startup code for days and already started to wonder why even the easiest examples are not running, even if same bossac version worked sucessfull with the arduino libarary. Truly the size seems to be a good explenation for this strange behaviour, since the binary is about 30 to 40kB with, and just some hundreds of bytes without the library.

Best regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.