mjs513
Senior Member+
As a follow up to my previous post on a settable system clock for circuit python on the T4.1 I finally got it working I think. Its basically a conversion of the T4 clocks.c in the core
Here are the files if you want to play.
1. In /ports/mimxrt10xx/common-hal/microcontroller the file Processor.c has to be updated to:
View attachment Processor.h View attachment Processor.c
2. In ports/mimxrt10xx/peripherals/mimxrt10xx clocks.h should change to:
View attachment clocks.h
3. In ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062 clocks.c should change to:
View attachment clocks.c
and
4.In shared-bindings\microcontroller
View attachment Processor.h View attachment Processor.c
To set a new clock speed:
Code:
PU freq: %d 960000000
Pystone(1.2) time for 500 passes = 57769777 ms
This machine benchmarks at 8655 pystones/second
CPU freq: %d 600000000
Pystone(1.2) time for 500 passes = 79864499 ms
This machine benchmarks at 6260 pystones/second
Here are the files if you want to play.
1. In /ports/mimxrt10xx/common-hal/microcontroller the file Processor.c has to be updated to:
View attachment Processor.h View attachment Processor.c
2. In ports/mimxrt10xx/peripherals/mimxrt10xx clocks.h should change to:
View attachment clocks.h
3. In ports/mimxrt10xx/peripherals/mimxrt10xx/MIMXRT1062 clocks.c should change to:
View attachment clocks.c
and
4.In shared-bindings\microcontroller
View attachment Processor.h View attachment Processor.c
To set a new clock speed:
Code:
microcontroller.cpu.setfreq(xxxx)