NabuCasa / yellow

Home Assistant Yellow - hardware for Home Assistant which grows with your needs.
Other
73 stars 11 forks source link

Check pull-up/down for SiLabs MGM210P radio module #10

Closed agners closed 3 years ago

agners commented 3 years ago

The Radio.RESET and Radio.BOOT signal seem to be in a undefined state at around ~1.7V by default. Both signals are pulled-low on the Raspberry Pi side by default, and high on the radio side (RPi has a internal pull up of 30-100kOhm according to forum posts, MGM210P states between 35 and 55kOhm in datasheet).

The MGM210P RESETn pin is by specification pulled to VDD. The Radio.BOOT singal is connected to PB00, which the boot loader uses as "Bootloader entry pin" (as Default Mode in Simplicity Studio's HW configuration). This seems to enable a internal pull-up as well (DOUT => 1 => pull-up):

  GPIO_PinModeSet(BSP_BTL_BUTTON_PORT,
                  BSP_BTL_BUTTON_PIN,
                  gpioModeInputPull,
                  BTL_GPIO_ACTIVATION_POLARITY);

(BTL_GPIO_ACTIVATION_POLARITY -> LOW -> 1)

void GPIO_PinModeSet(GPIO_Port_TypeDef port,
                     unsigned int pin,
                     GPIO_Mode_TypeDef mode,
                     unsigned int out)
{
  EFM_ASSERT(GPIO_PORT_PIN_VALID(port, pin));

  /* If disabling a pin, do not modify DOUT to reduce the chance of */
  /* a glitch/spike (may not be sufficient precaution in all use cases). */
  if (mode != gpioModeDisabled) {
    if (out) {
      GPIO_PinOutSet(port, pin);
    } else {
      GPIO_PinOutClear(port, pin);
    }
  }
/** Input enabled. DOUT determines pull direction. */
  gpioModeInputPull                 = _GPIO_P_MODEL_MODE0_INPUTPULL,

DOUT set means pull-up enabled.

agners commented 3 years ago

Both signal seem to be sampled as high currently.

Radio.BOOT is by default a low active signal. We can either reconfigure our boot loader, or add a pull-up to make sure the signal is high.

Similarly reset, we probably should tie it to VDD to make sure the module is out of reset by default.