Giter VIP home page Giter VIP logo

Comments (7)

dhalbert avatar dhalbert commented on May 20, 2024

Nope, we haven't tried this, since the 16kB allocated for the SAMD51 bootloader means we haven't had to try to squeeze it to save space.

from uf2-samdx1.

wallarug avatar wallarug commented on May 20, 2024

So does that mean it is not implemented / cannot be done at this very moment in the same way as SAMD21?

from uf2-samdx1.

dhalbert avatar dhalbert commented on May 20, 2024

No, it just means I haven't tried it :). Sounds like a bug.

from uf2-samdx1.

wallarug avatar wallarug commented on May 20, 2024

😎

Righto - well when you do try - this is what happens...

image

It complains that:

  • BOOT_GCLK_ID_CORE
  • BOOT_GCLK_ID_SLOW
  • BOOT_USART_BUS_CLOCK_INDEX

... are not defined.

Interesting that it doesn't complain about the other ones.

from uf2-samdx1.

dhalbert avatar dhalbert commented on May 20, 2024

USE_UART is by default set to 0 in inc/uf2.h. The #if's that use it seem to be OK. What are you changing that causes the errors above? I'm a little confused.

from uf2-samdx1.

wallarug avatar wallarug commented on May 20, 2024

I'm going from this config:

#ifndef BOARD_CONFIG_H
#define BOARD_CONFIG_H

#define CRYSTALLESS    1

#define VENDOR_NAME "Robotics Masters"
#define PRODUCT_NAME "Robo HAT MM1 M4"
#define VOLUME_LABEL "ROBOM4BOOT"
#define INDEX_URL "https://roboticsmasters.co"
#define BOARD_ID "SAMD51G19A-RoboHATMM1-v24"

#define USB_VID 0x1209
#define USB_PID 0x4D44

#define LED_PIN PIN_PB22

#define BOOT_USART_MODULE                 SERCOM1
#define BOOT_USART_MASK                   APBAMASK
#define BOOT_USART_BUS_CLOCK_INDEX        MCLK_APBAMASK_SERCOM1
#define BOOT_USART_PAD_SETTINGS           UART_RX_PAD1_TX_PAD0
#define BOOT_USART_PAD3                   PINMUX_UNUSED
#define BOOT_USART_PAD2                   PINMUX_UNUSED
#define BOOT_USART_PAD1                   PINMUX_PA17C_SERCOM1_PAD1
#define BOOT_USART_PAD0                   PINMUX_PA16C_SERCOM1_PAD0
#define BOOT_GCLK_ID_CORE                 SERCOM1_GCLK_ID_CORE
#define BOOT_GCLK_ID_SLOW                 SERCOM1_GCLK_ID_SLOW

#endif

To this config:

#ifndef BOARD_CONFIG_H
#define BOARD_CONFIG_H

#define CRYSTALLESS    1

#define VENDOR_NAME "Robotics Masters"
#define PRODUCT_NAME "Robo HAT MM1 M4"
#define VOLUME_LABEL "ROBOM4BOOT"
#define INDEX_URL "https://roboticsmasters.co"
#define BOARD_ID "SAMD51G19A-RoboHATMM1-v24"

#define USB_VID 0x1209
#define USB_PID 0x4D44

#define LED_PIN PIN_PB22
#endif

Nothing too spectacular 😄 .

from uf2-samdx1.

wallarug avatar wallarug commented on May 20, 2024

It's easy to fix to make it compile again... it's just a question of is it providing the correct functionality. It would appear that UART was always building in anyway for all bootloaders but just not running (depending on processor and configuration).

https://github.com/microsoft/uf2-samdx1/blob/master/src/usart_sam_ba.c#L120

    #ifdef SAMD51
    #if USE_UART
    GCLK->PCHCTRL[BOOT_GCLK_ID_CORE].reg = GCLK_PCHCTRL_GEN_GCLK0_Val | (1 << GCLK_PCHCTRL_CHEN_Pos);
    GCLK->PCHCTRL[BOOT_GCLK_ID_SLOW].reg = GCLK_PCHCTRL_GEN_GCLK3_Val | (1 << GCLK_PCHCTRL_CHEN_Pos);

    MCLK->BOOT_USART_MASK.reg |= BOOT_USART_BUS_CLOCK_INDEX ;
    #endif
    #endif

I would argue that the USE_UART should be at the top of this file / all functions not needed by the bootloader.

from uf2-samdx1.

Related Issues (20)

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.