Print Page | Close Window

RGB controller

Printed From: ASRock.com
Category: Technical Support
Forum Name: AMD Motherboards
Forum Description: Question about ASRock AMD motherboards
URL: https://forum.asrock.com/forum_posts.asp?TID=10395
Printed Date: 05 Feb 2025 at 12:55pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: RGB controller
Posted By: wegrzycki_
Subject: RGB controller
Date Posted: 13 Dec 2018 at 9:58pm
Hi, I'm trying to write driver for rgb control under linux for x470 taichi, and I have troubles with discover which GPIO ports controls leds, I had tried dumping all registers from superIO chip, after changing colors in bios but it didn't works. After some research I found info that leds are controlled by other chip N76E885AT20 I assume that it is connected to superIO chipset via his GPIO interface but I have no idea which ports are used for that purpose. Do anyone have any idea how to discover which pins are controlling led's?



Replies:
Posted By: mylinuxguy
Date Posted: 11 Jan 2019 at 10:17pm
Have you made any progress on this? I've got linux and an 470 taichi board too.

- jack

-------------
- jack


Posted By: poke3220
Date Posted: 19 Jun 2019 at 5:09pm
Would be great to be able to control the LEDs from Linux.
But without some basic help from ASrock on how the LEDs are controlled will be very difficult and time consuming.


Posted By: poke3220
Date Posted: 19 Jun 2019 at 5:36pm
My board ASROCK AB350M also uses the Nuvoton N76E885AT20 chip to drive the LEDs. From the datasheet the main difference on pin level that I see is that the 20 pin package doesn't export the P3 port. The N76E885AT20 has a builtin 8051 processor, this means that program is written and flashed by ASROCK. The interresting thing is that we don't need to know the program. The N76E885AT20 talks (RX/TX) to the SuperIO chip NCT6779D, which is accessible from Linux. Our best bet is to install Windows and ASROCK's RGB application and start snooping what it tries to write to the SuperIO chip.


Posted By: poke3220
Date Posted: 19 Jun 2019 at 5:50pm
Maybe some of these tools might reveal the secret saus:
https://docs.microsoft.com/en-us/sysinternals/downloads/process-utilities


Posted By: CalcProgrammer1
Date Posted: 16 Aug 2019 at 2:09am
Anyone who wants to help reverse engineer ASRock RGB, please check the issue below:

https://gitlab.com/CalcProgrammer1/OpenAuraSDK/issues/35

I reversed Asus Aura and wrote an open source driver for it and I'd like to help do the same for ASRock boards (and others). Asus used SMBus and USB in their implementation. I'm wondering if ASRock did the same.


Posted By: EUA
Date Posted: 09 Oct 2019 at 10:15am
Hello Gentlemen.
I am also wanted to control my Fatal1ty AB350 Gaming ITX/ac LEDs.
But I surprised about an MCU (N76E88x) is available onboard for just driving LED lightning.
I wish they don't use it some nasty security things, since it's closed sourced.

I have mailed to support recently, asking about the API or engineering document about LED lightning drivers but I don't think if they give a f.

So I armed and engage the war mode.
There are 3 attack vectors.
1. Disassembly of AsrRgbLed.exe (picked)
2. Reversing the BIOS Led utility.
3. Disassembly of N76E88x firmware (nu51_1.10) located on AsrLed directory.

From last to first;
3. one is the MCU that I don't play with it before. At worst case scenario, even if I can't disassemble it, we could reprogram it with our custom firmware.
2. Since BIOS has the RGB Led Utility inside, we could cut out the required binary with UEFITools and inspect.

1. Old friend IDA Disassembler with little free time.
But first, I just inspect the binary with PE Tools and saw that it utilizes SMBus. So probably all communication done via SMBus to N76E88x chip. It also uses AsrDrv103.sys file.

I also put it under IDA Debugger and renamed some functions. I don't understand how it communicates, yet. There are some strings make me suspicious about if communication uses some sort of UART connection instead of SMBus because it looks like whole strings are passed for communication some thing like "SetBreathing"...etc.
I don't know how much will it stand.

Also we could use SMBus eavesdropper using old DDR4 module, soldering 3 pins and could record all SMBus communication physically via RPI like SBCs to. If it communicate with it, If LED Controller don't use SMBus, than my best guess is probably using SuperIO's UART for communicate.


Posted By: EUA
Date Posted: 11 Oct 2019 at 1:56am
I am working on it for a while.
I found that it uses SMBus, because if you disable AMD SMBus device, program doesn't work, proper.

I am debugging via IDA and found some transaction variables.
Commands send to AsrDrv103.sys I think.

Transactions modes are:
0x11 Static
0x12 Breathing
0x13 Strob
0x14 Cycle
0x15 Rand
0x16 Rand??
0x17 Music
0x18 Wave

And RGB send via 3 byte sequence as R-G-B values.
I believe that SMBus 0x36 is the nuvoton N76E885AT20.
Which give all 0xFF on the i2cdump.
Well who want to buy me a beer?


Posted By: EUA
Date Posted: 14 Oct 2019 at 7:03am
Looks like no one interested...

Anyway, I installed AsrPolychromeRGBSetup(v1.0.60). Since it's doesn't work, I made flash update with firmware : nu51_2.10 It flashed properly, make my leds bring white but... Control program doesn't work. Indeed there are no compatibility issue or anything... As a Ms Computer Engineer, I can clearly say that: ASROCK JUST AVOID US TO USE NEW PROGRAM BECAUSE OF NOTHING.

Anyway. I verify that 0x6a is the guy.

Debug shows that AsrLed connected to the 0xB20 port at 0x790B1022. Control registers at 0xFED80300. So soldering to DDR4 Stick RAM pins to eavesdrop communication trick will not work at least on my AsRock Fatal1ty B350 Gaming-ITX/ac becuse of different smbus used. But direct attaching wire to i2c pins (8 SDA, 13 SCL) of N76E885AT20 will work. Anyone? Well, I think same. Hard to solder this tiny pins and could be worst case scenario. Better, continue to debugging...

I think I captured good i2c data but. It doesn't actually work on Linux. Why? Do I miss some initialization communication etc? I don't know. AsRock might use some type of lock mechanism to avoid naughty users. Like us.


Posted By: EUA
Date Posted: 17 Oct 2019 at 10:58am
Done!
I gain *complete* control on nu51_1.10 firmwared MBs.
Unfortunately PolycromeRGB firmware is not compatible with it and don't have MB to reverse it. I can make it if anyone send me B450 board.


Posted By: EUA
Date Posted: 18 Oct 2019 at 8:52am
Here is the solution: https://github.com/EUA/AsrLed
It's compatible with nu51_1.10 firmwared N76E885AT20 devices.

X/B450 boards are with same MCU but nu51_2.10 firmware.
Since our chips are same, you can try to downgrade your firmware with AsrLed tool that's available at Fatality Gaming B350 ITX board download section.

http://asrock.pc.cdn.bitgravity.com/Utility/RGB/RGBLED(v1.0.41).zip

I upgrade mine to nu51_2.10 fw but AsrPolychrome doesn't work with it. So I can't debug it and downgrade back to nu51_1.10 with this command.

C:\Program Files (x86)\ASRock Utility\ASRRGBLED\Bin\wICPFLASH.exe /file=nu51_1.10

Also, at my MoBo, chip connected to SMBus address 0b20.

Ryzen >i2cdetect -l
i2c-1     unknown        SMBus PIIX4 adapter port 2 at 0b00     N/A
i2c-2     unknown        SMBus PIIX4 adapter port 1 at 0b20     N/A
i2c-0     unknown        SMBus PIIX4 adapter port 0 at 0b00     N/A

You need to update your i2c_piix4 driver.
Arch and compatible users could use:

yaourt -S aur/i2c-piix4-aura-dkms

That's all. :)


Posted By: RattyDAVE
Date Posted: 24 Nov 2019 at 1:44am
I have done some research on this and documented in

https://github.com/RattyDAVE/asrock-leds/blob/master/changeled.sh

This has all the funtions of the firmware in my BIOS.


Posted By: brjhaverkamp
Date Posted: 28 Nov 2019 at 8:05pm
Hi all,

This looks like tremendous progress on the led control of Asrock MBs.
I own a BM450M Pro4. Would this potentially work on this MB as well?

And if so, what do I need to do to help make it work:-)
I'm happy to do tests/provide traces/logs, etc.
I have reasonably developed Linux skills, but little experience in debugging and reverse engineering, so I would need some pointers/instructions.
My machine has both windows 10 as Ubuntu 19.10 installed

Oh, and maybe some Arock person who reads this can pick up on this and help with info on the programming interface for the LED controler? Please??
This is hardly sensitive information, just the registers and adresses and their function would suffice.

Kind regards,

Bert


Posted By: eddie55
Date Posted: 15 Dec 2019 at 9:04pm
Bump for Official ASRock support for linux users using RGB


Posted By: Ray62
Date Posted: 15 Dec 2019 at 9:14pm
Guys, there is no official Asrock support in this forum.
If you want support, you have to create a ticket.

-------------
Asrock Fatal1ty X370 Professional Gaming Offline
Under test:
MSI X570_MEG_ACE | AMD Ryzen 9 3900X | Scythe Mugen5 | 2x16GB F4-3200C14D-32GTZ@3466 | ASUS GeForce GTX 1080 Ti FE


Posted By: brjhaverkamp
Date Posted: 19 Dec 2019 at 8:38pm
Hi all,

Yes, I know. It is a long shot. But sometimes the fora are monitored by support employees, so one can hope, can't he?:-) But a ticket might be worth the effort as well.

Back on the topic: I am trying to get one the tools running on my Asrock B450M PRO4
With icetect -l I dont see port 1 at 0b20 unfortunately. Only 3 otherports on 0b00.(I forgot the numbers and am not at that computer right now)

In the notes from RattyDAVE you have the instructions you used to update the module, I gather.
#sudo pacman -S i2c-tools linux-latest-headers
#yay -S --answerclean A --answerdiff N i2c-piix4-aura-dkms #this adds the 0b20 SMBus
#sudo modprobe i2c_dev
EUA has something similar to apply a patch from what I understand.

But how do they translate to ubuntu? I couldn't quickly find the patch to the module that it is applying.

Kind regards,

Bert


Posted By: frostmorn
Date Posted: 23 Jul 2020 at 11:55pm
do you have the firmware to flash this microcontroller through the programmer?



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net