UltimateHackingKeyboard / firmware

Ultimate Hacking Keyboard firmware
Other
420 stars 66 forks source link

Momentary random colors upon booting #673

Closed mondalaci closed 10 months ago

mondalaci commented 1 year ago

When powering up the UHK, random key colors can be seen for a moment. This is slightly disturbing and should be avoided.

kareltucek commented 1 year ago

Looks like factory mode is partially broken since following commit:

commit 481698e35f4196620a6884f764cbeaddf61a7e4d
Author: László Monda <laci@monda.hu>
Date:   Wed Feb 22 10:45:21 2023 +0100

    Put CurrentKeymap into the .data2 section because it wouldn't fit into .data1 with the RGB values included.

Scenario 1:

Scenario 2:

Scenario 3:


@mondalaci does this ring any bells?

Is there anything special about how the data2 segment is initialized?

mondalaci commented 1 year ago

This doesn't ring a bell to me.

If there's anything special about the data2 segment, the https://community.nxp.com/ forum may be able to help.

Any further questions or findings, please do let me know.

kareltucek commented 1 year ago

More observations:

mondalaci commented 1 year ago

Chances are data(2) segment(s) are uninitialized by default for performance reasons and they should be explicitly initialized when required.

kareltucek commented 10 months ago

No luck with a nxp inquiry... ( https://community.nxp.com/t5/Kinetis-Microcontrollers/m-data-2-not-initialized/m-p/1785711 )

I guess it is time for the suggested workaround of initializing it explicitly ourselves?

mondalaci commented 10 months ago

Let's ask our NXP contact before using the workaround. I'll provide his contact via email very soon.

It's worth mentioning that the part number of the MCU is MK22FN512VLH12. The K22P121M120SF7 is some sort of identifier in the datasheet that covers multiple MCUs of the same kind.

kareltucek commented 10 months ago

I think I have a working version, thanks to bobpaddock's today reply. It edits lib/KSDK_2.0_MK22FN512xxx12/devices/MK22F51212/gcc/startup_MK22F51212.S. Should I post a PR into the UHK submodule repository, or should I create a copy of that file directly in firmware repository?

mondalaci commented 10 months ago

The former should be the correct way if the fix belongs to a file in the KSDK repo.