1. 29 Apr, 2019 1 commit
    • Damien George's avatar
      stm32/powerctrl: Deselect PLLSAI as 48MHz src before turning off PLLSAI. · 8031b7a2
      Damien George authored
      On the STM32F722 (at least, but STM32F767 is not affected) the CK48MSEL bit
      must be deselected before PLLSAION is turned off, or else the 48MHz
      peripherals (RNG, SDMMC, USB) may get stuck without a clock source.
      
      In such "lock up" cases it seems that these peripherals are still being
      clocked from the PLLSAI even though the CK48MSEL bit is turned off.  A hard
      reset does not get them out of this stuck state.  Enabling the PLLSAI and
      then disabling it does get them out.  A test case to see this is:
      
          import machine, pyb
          for i in range(100):
              machine.freq(122_000000)
              machine.freq(120_000000)
              print(i, [pyb.rng() for _ in range(4)])
      
      On occasion the RNG will just return 0's, but will get fixed again on the
      next loop (when PLLSAI is enabled by the change to a SYSCLK of 122MHz).
      
      Fixes issue #4696.
      8031b7a2
  2. 28 Apr, 2019 6 commits
  3. 26 Apr, 2019 4 commits
  4. 25 Apr, 2019 1 commit
    • Damien George's avatar
      tools/pyboard.py: Don't accumulate output data if data_consumer used. · 56f6ceba
      Damien George authored
      Prior to this patch, when a lot of data was output by a running script
      pyboard.py would try to capture all of this output into the "data"
      variable, which would gradually slow down pyboard.py to the point where it
      would have large CPU and memory usage (on the host) and potentially lose
      data.
      
      This patch fixes this problem by not accumulating the data in the case that
      the data is not needed, which is when "data_consumer" is used.
      56f6ceba
  5. 24 Apr, 2019 1 commit
    • Damien George's avatar
      stm32/dac: Rework DAC driver to use direct register access. · aa7b32c8
      Damien George authored
      This patch makes the DAC driver simpler and removes the need for the ST
      HAL.  As part of it, new helper functions are added to the DMA driver,
      which also use direct register access instead of the ST HAL.
      
      Main changes to the DAC interface are:
      
      - The DAC uPy object is no longer allocated dynamically on the heap,
        rather it's statically allocated and the same object is retrieved for
        subsequent uses of pyb.DAC(<id>).  This allows to access the DAC objects
        without resetting the DAC peripheral.  It also means that the DAC is only
        reset if explicitly passed initialisation parameters, like "bits" or
        "buffering".
      
      - The DAC.noise() and DAC.triangle() methods now output a signal which is
        full scale (previously it was a fraction of the full output voltage).
      
      - The DAC.write_timed() method is fixed so that it continues in the
        background when another peripheral (eg SPI) uses the DMA (previously the
        DAC would stop if another peripheral finished with the DMA and shut the
        DMA peripheral off completely).
      
      Based on the above, the following backwards incompatibilities are
      introduced:
      
      - pyb.DAC(id) will now only reset the DAC the first time it is called,
        whereas previously each call to create a DAC object would reset the DAC.
        To get the old behaviour pass the bits parameter like: pyb.DAC(id, bits).
      
      - DAC.noise() and DAC.triangle() are now full scale.  To get previous
        behaviour (to change the amplitude and offset) write to the DAC_CR (MAMP
        bits) and DAC_DHR12Rx registers manually.
      aa7b32c8
  6. 23 Apr, 2019 1 commit
  7. 18 Apr, 2019 6 commits
  8. 16 Apr, 2019 1 commit
  9. 15 Apr, 2019 5 commits
  10. 12 Apr, 2019 2 commits
  11. 11 Apr, 2019 4 commits
  12. 09 Apr, 2019 1 commit
  13. 08 Apr, 2019 6 commits
  14. 05 Apr, 2019 1 commit