adafruit / tinyuf2

UF2 bootloader based on TinyUSB for embedded devices such as ESP32S2, STM32F4 and iMX RT10xx
MIT License
310 stars 170 forks source link

mimxrt1011, 400mhz support #286

Closed ccrome closed 1 year ago

ccrome commented 1 year ago

Operating System

Linux

INFO_UF2.TXT

If i'm not mistaken, I believe that the default mimxrt1011 tinyuf2 starts at 500MHz. It should probably start at 400Mhz or lower to ensure that it's compatible with all chip revisions.

I might be mistaken -- I used the mcu config tools to read the clock_config.c file, so it's quite possible that process didn't work right.

What happened ?

I think the system is starting at 500Mhz, which is well outside the specs for the 400mhz part.

How to reproduce ?

just putting something here because i have to.

Debug Log

No response

Screenshots

No response

tannewt commented 1 year ago

The only version I see here is 500mhz capable. Where is a 400mhz part documented?

ccrome commented 1 year ago

in the "Buy/Paramettrics" tab.

image

hathach commented 1 year ago

each board has its own clock_config.c/h and can be configured individually, yes ?

ccrome commented 1 year ago

each board has its own clock_config.c/h and can be configured individually, yes ?

Yes. Now that I think about it, this really isn't a bug for the imxrt1010_evk. It's that I was using the imxrt1010_evk as a placeholder for 'all i.mx RT 1011 based boards'.

I guess it's just a policy choice: do you want the clock speed set to the maximum clock speed available for that particular board, or the maximum clock speed supported by all members of the CPU family? The former means when transitioning from an evk to a custom board, it's easy to miss the fact that the clock speed of the chip is different (exactly what happened to me), vs. the bootloader running at lower clock speed.

Actually, now that I think about it, does the bootloader need to run at such high speeds at all? Perhaps it should just leave the PLL disabled and run everything at 24 MHz?

@gsteiert any opinion here? I was wondering if we should do the minimum amount of clock setup necessary to make things go, so it's left for the app in as close to reset state as possible. Rather than doing the full auto-generated BOARD_BootClockRUN call.

hathach commented 1 year ago

Each board should configure its preferred clock individually with clock_config. I don't think we need to set any minimum or maximum clock at all. They should run with their optimum design (crystal/power etc...). If you accept this answer, we can close this issue.

gsteiert commented 1 year ago

I agree it should be left to each board to decide. They may need different settings for a different clock source or crystal frequency. Also, some of the settings may be required to run USB.

On Thu, Mar 2, 2023, 8:47 PM Ha Thach @.***> wrote:

Each board should configure its preferred clock individually with clock_config. I don't think we need to set any minimum or maximum clock at all. They should run with their optimum design (crystal/power etc...). If you accept this answer, we can close this issue.

— Reply to this email directly, view it on GitHub https://github.com/adafruit/tinyuf2/issues/286#issuecomment-1452963973, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJZ2HJRUMYRMVLXVDSZLEPDW2FZXZANCNFSM6AAAAAAVATCI44 . You are receiving this because you were mentioned.Message ID: @.***>

ccrome commented 1 year ago

Yep, makes sense to me, closing...