Any experience with Nuvoton MCUs? - Page 1
Forum section: electronics / general

author: ataradov
author_rank: Super Contributor
timestamp: July 20, 2022, 05:17:28 am
content: I wonder if anyone here uses Nuvoton MCUs for anything? I'm specifically interested in ARM, but any other would work too for information.There seem to be no information about them on forums and they are not the name that comes up first in searches. So, I wanted to see if anyone uses/used them for anything hobby or work related.A couple years ago I was searching for a small pin count MCU with USB HS device controller and integrated PHY. It is not easy to find devices like this from common well known vendors and when you do the price starts from $12.So, back then I started looking for all sorts of off-beat stuff and found Nuvoton. They basically had the perfect device for what I needed - M484SIDAE (192 MHz Cortex-M4F) and the price was unmatched ($3.5 small quantity).They also have NUC505DLA, which is slightly slower Cortex-M4 device, but still with USB HS. And at even cheaper price.And they also had a promotion at a time where you get 90% off your first 5 samples of any 5 devices (25 ICs total). I ordered a bunch of different devices and the total was $12 including shippingBack then I made a simple breakout board for M484SIDAE, made a basic project and never got around to USB stuff. Well, this weekend the time to play with USB came, so I made a port of Free-DAP to that device (https://github.com/ataradov/free-dap/tree/master/platform/m484).Based on that I have mixed feelings. The documentation is interesting. It is very bare, like there is no way a novice would be able to figure anything out. I had no serios issues, although at times I wished there was more information. The whole description of the USB HS Device peripheral is literally 2 pages (excluding register bits). I was able to figure it out, but mostly because I programmed a lot of much worse stuff before. And unlike with common vendors, finding information on the web is impossible. There is literally nothing.The hardware is well designed. I have some basic complaints, but overall it is much better than a lot of stuff from mainstream vendors.During the past couple years I checked their store and the devices I was interested in stayed available all the time. I guess partially due to relative obscurity.Yesterday I placed a bigger order and the price was actually cheaper than 2 years ago when I got samples.So, yes, if anyone had any experience with them, I'd like to hear. And if not - check them out. They might work for you, especially given the current situation.

author: ataradov
author_rank: Super Contributor
timestamp: July 20, 2022, 05:22:32 am
content: Their multiplexing table shows SWD host options, but there is nothing about that in the document itself. Given my target application, I was interested in learning more. I contacted their support back then and they were responsive. They also asked if this was for Microchip business or personal use. So, they clearly knew who I was, since nothing in my account ties me to Microchip. I answered that it was for personal use, but they still would not tell me anything other than that there is indeed an SWD host controller, but it is reserved for their own use in the on-board debuggers.

author: rooppoorali
author_rank: Regular Contributor
timestamp: July 20, 2022, 11:51:01 am
content: No. No experience. But today I saw someone in another forum asking about Nuvoton. Apart from this I never heard of it before, honestly.

author: wraper
author_rank: Unknown
timestamp: July 20, 2022, 11:59:03 am
content: Quote from: rooppoorali on July 20, 2022, 11:51:01 amNo experience either but it's a company mostly supplying big guys. It's was spun-off by Winbond and is fully owned by them. Nuvoton ICs are most often found on computer motherboards.

author: voltsandjolts
author_rank: Unknown
timestamp: July 20, 2022, 12:12:11 pm
content: Well, good on you for investing some time in Nuvoton devices, can be a risky investment for some Chinese parts but sounds like it paid off this time. I haven't tried any Nuvoton stuff, I did look at their 8051 parts butthis reportof some quirky reset behavior put me off. It's little things like that that can cost quite some time, and combined with often poor documentation of Chinese parts in general, I tend to stick to Western parts. They have quirks too but much less of a risk.Nuvoton identified you as a Microchip guy, so I guess they must do an internet search on all folks that contact them

author: wraper
author_rank: Unknown
timestamp: July 20, 2022, 02:14:36 pm
content: They are not Chinese but Taiwanese. And they are a large company, not some obscure Chinese stuff.

author: mon2
author_rank: Frequent Contributor
timestamp: July 20, 2022, 02:34:31 pm
content: Nuvoton ? This is the new name from the former Winbond microcontroller group. We have used Winbond in the past but dating myself to the 8051 days. I do not believe you will have any issues with the company as they are real and here to help. Fairly sure they have a USA office so carry on. Not sure if there are cost savings but they appear to have silicon while others cry the blues with lead times and offer their wares at inflated prices.However, have received numerous emails from assorted brokers in Asia in the last 48 hours that silicon prices are starting to drop for micros like the STM32F103 (original).https://en.wikipedia.org/wiki/Nuvoton

author: tszaboo
author_rank: Super Contributor
timestamp: July 20, 2022, 03:05:18 pm
content: I have two dev boards from them, they were really eager to hand them out few years ago on Electronica. As I remember setting up the environment was easy, but it was years ago. It's now on the bottom of the drawer, because I didn't see the benefit really. Lenovo is using them for some stuff in their laptops, so they are probably fine.

author: ataradov
author_rank: Super Contributor
timestamp: July 20, 2022, 03:41:23 pm
content: Just to clarify, I was not expecting that there is anything wrong with them as a company. Indeed, I've learned their name from looking at some server motherboards, where they are used a lot.It is just strange that they are not used more in hobby and even more consumer stuff. I guess lacking documentation is a problem, but before that hobbyists adapted to poor documentation for interesting parts. And they definitely have some very attractive parts when it comes to performance per dollar.

author: uer166
author_rank: Super Contributor
timestamp: July 20, 2022, 03:46:41 pm
content: I've looked at their mixed signal/CAN enabled Cortex M4 parts but it never went anywhere. They have some good parts at least on paper, so subscribed to see what the real world experience is. If anyone tried their advanced analog features that would be cool to see!

author: benSTmax
author_rank: Regular Contributor
timestamp: July 20, 2022, 05:51:25 pm
content: I bumped into Nuvoton micros a few months ago. Not really for a development experience, but for a small hack.Last year, I got this USB/HDMI 4-port switch to handle multiple devices.I connected my keyboard, mouse and a USB hub with all the embedded stuff through this switch. The reason was to be able to access them all from Linux, Win and RPI machines without messing up with the USB connections all the timeEverything seemed to work fine, but from time to time, all those USB devices connected through the switch weren't visible to any of the host machines.The fix was to disconnect all the USBs, HDMI cables and external power, so the switch can reset itself by cutting all the power supply sources (the device can power itself up partially through HDMI, too; not to mention USB)This annoying thing was happening about once a week and it was annoying enough to make me find a solution.So, I opened up the switch and after a bit of reverse engineering I realized the culprit for this situation was a Nuvoton micro but having a custom part number.After checking some of the connection on the PCB, I traced back the part as being N79E82xA. This isn't an ARM cpu core, but an 8051-type.Now, going back to the original post, indeed Nuvoton seems to have interesting micro solutions however not all of their products have the same level of support (documentation, app notes, ...) and they seem to be encountered mostly on computer-related hardware/accesoriesPS: The micro's firmware seemed to get stuck in those certain situations, so my solution was to install a small push button that would force low the micro's reset pin. The solution works since I was able to test it(when the switch' usb got stuck) quite a few times since I added the push button

author: abyrvalg
author_rank: Frequent Contributor
timestamp: July 20, 2022, 10:10:24 pm
content: Nuvoton has their own debug adapter called nu-link. Perhaps it uses that undocumented SWD master peripheral and it is possible to find something out from it’s firmware?

author: PCB.Wiz
author_rank: Super Contributor
timestamp: July 20, 2022, 10:46:49 pm
content: Quote from: ataradov on July 20, 2022, 05:17:28 amNuvoton have been around for a long time, they were spun off from Winbond.We've used their 8051 variants over the years, and have a number of their Eval boards here.They have a forum herehttp://forum.nuvoton.com/index.phpthat is only moderately active.Nuvoton do at least have quite good English data sheetsQuote from: ataradov on July 20, 2022, 05:17:28 amNot from Nuvoton, but a recent device I spotted with HS-USB in a small package (TSSOP20), is the CH347 from WCHand that USB_UART bridge is based on their CH32V307 family, also in TSSOP20https://www.wch.cn/products/CH32V307.htmlWCH data is rather worse than Nuvoton, but they also seem to have an active code example activity on github.Quote from: ataradov on July 20, 2022, 05:17:28 amHow did the Nuvoton performance compare with the other ports you have done ?

author: ataradov
author_rank: Super Contributor
timestamp: July 20, 2022, 11:30:52 pm
content: Quote from: PCB.Wiz on July 20, 2022, 10:46:49 pmThey have good English in the parts they have. I would not call datasheets good overall, quite the opposite for a general purpose MCU. They barely have any description for most peripherals.Quote from: PCB.Wiz on July 20, 2022, 10:46:49 pmI've looked though all the device from WCH. But I need an actual MCU capable or running a custom firmware, not just an interface to a couple fixed protocols.Quote from: PCB.Wiz on July 20, 2022, 10:46:49 pmI have not checked full bandwidth performance. It does not have dual bank endpoints, so I assume it would be hard to get full bandwidth, but I don't think it would be too far off.But for the DAP use it has the same performance as SAM E70 implementation.

author: ataradov
author_rank: Super Contributor
timestamp: July 20, 2022, 11:33:10 pm
content: Quote from: abyrvalg on July 20, 2022, 10:10:24 pmI'm sure it is possible to figure it out, I just did not want to spend a lot of time on that. I sort of assumed that their firmware would be locked and updates encrypted, but I have not checked. I'm not too invested in getting it to work, but I'll look into it just for fun.

author: ataradov
author_rank: Super Contributor
timestamp: July 20, 2022, 11:56:20 pm
content: I just did a quick check with a VCP driver and I get 13 MByte/second transfers both TX and RX. This is with a firmware that is not fully optimized for the speed and obviously going through a terminal program and VCP drivers. I'm sure raw performance would be better. But again, without double buffered endpoints, it will never be anywhere close to 50 MBytes/s.But you don't really need it on this device. There is no way it can process incoming stream this fast and there are no other interfaces that are this fast. So, their design is a reasonable compromise between the performance and simplicity.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: July 21, 2022, 03:43:38 am
content: Quote from: ataradov on July 20, 2022, 11:30:52 pmDid you look at the CH32V307 family I linked ?That is'an actual MCU capable or running a custom firmware'

author: ataradov
author_rank: Super Contributor
timestamp: July 21, 2022, 04:16:49 am
content: Quote from: PCB.Wiz on July 21, 2022, 03:43:38 amI looked at them when they were released, but at the time I could not find even approximate pricing. They are now available on LCSC, which is great.The price difference is definitely not enough for me to switch from M484 to the CH32V307. The smallest package available is TQFP-64-0.5mm, while M484 has 0.4mm pitch, which makes the device very small.I'm also not a huge fan of RISC-V. But also, WCH is the only company that makes RISC-V devices somewhat bearable, mostly by not doing any nonsense and using the same general architecture.But I'll keep an eye on the CH32V305, which is not available yet. But the package is interesting.I'm also interested in exploring how well it actually works with USB HS at full load. Typically USB HS is very noisy and requires a bit of power supply filtering for the PHY. In their devices there does not seem to be even a bypass pin for the core voltage regulator. I wonder if they actually made it work, or there is something funky going on.Ok, I had to dig deeper on that power supply stuff. I was starting to think that they might have caps in the package, but it looks like not -https://twitter.com/travisgoodspeed/status/1514673842555392004They do have some really solid power supply routing though. I guess this helps. Because if they actually figured out how to make Ethernet and HS USB work in the same package without crazy bypass/decoupling requirements, it is amazing.Although there is also a chance that Travis lost the capacitors in the decaping process.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: July 21, 2022, 05:45:55 am
content: Quote from: ataradov on July 21, 2022, 04:16:49 amI think there is a CH32V305FBP6 in TSSOP20, but actually getting parts right now, is not indicated ?

author: ataradov
author_rank: Super Contributor
timestamp: July 21, 2022, 05:53:30 am
content: Quote from: PCB.Wiz on July 21, 2022, 05:45:55 amYes, and once it becomes available, I'll buy some for experiments. Right now 305 is not available anywhere. You can get 307 pretty easily.307 with its very simple power supply and a very good peripheral set is very interesting, and I'll keep it in mind, but right now I have other things to deal with.

author: ataradov
author_rank: Super Contributor
timestamp: July 22, 2022, 06:29:57 am
content: Quote from: abyrvalg on July 20, 2022, 10:10:24 pmWell, I got curious and decided to give it a go. I don't have the firmware, and I would not want to obtain this information from reverse engineering of the firmware anyway.The device has both SWD host interface and ETM trace capture interface. I'm not so interested in the SWD host part, since with fast MCUs you can just bit-bang things fast enough. But ETM part is interesting.And you don't really need to reverse engineer a lot. They completely failed to scrub their documentation from mentions of those peripherals. The pins/ports are fully documented. They removed them from some devices in the series, but this just left holes in the multiplexing tables, so it is not that hard to figure it out. Older versions of the datasheet also mention DMA channel associated with ETM. Newer versions have it as "reserved".They also left base addresses for both peripherals right in the reference manual. Although I kind of manually figured them out anyway, since I could not imagine they would mention them directly.And interrupt vectors corresponding to the peripherals are also mentioned, although there is a formatting error in this part that was carried from the first version of the manual to the latest.All of this is pretty easy to figure out knowing that those peripherals are there anyway, but they helpfully forgot to remove that stuff from the manual.They also published pictures of their debugger board with clearly visible traces to the MCU from the trace port right in the debugger user manual. The debugger is cheap enough ($150) to just buy for poking at it, but they decided to publish pictures on their own. And given all the previos information, there is really nothing interesting in that debugger.I wrote random values into peripheral registers, and I was able to get the clock on the SWD interface. The rest is just trial and error process for figuring out what those bits mean. This is easy, since this makes device actively generate signals.I also tried to do the same for the trace port, and I also got the data to appear in the memory map of the peripheral. I slowly bit-banged the trace data from the same device, so I have full control over it. The rest is again just figuring out what the bits mean. And there are not a lot of bits, just one configuration register with half the bit unimplemented.This weekend would be fun.

author: ttt
author_rank: Regular Contributor
timestamp: July 22, 2022, 05:21:08 pm
content: Quote from: ataradov on July 22, 2022, 06:29:57 amI am using a M484SIDAE2U part (https://github.com/tinic/pendant2022/blob/main/CMakeLists.txt). Personally I am using SWD through an STLink/2-1. Pretty vanilla Cortex-M part IMO.What's really annoying is that Nuvoton maintains a fork of an old version of OpenOCD to support their chips (https://github.com/OpenNuvoton/OpenOCD-Nuvoton). This is causing me all kinds of headaches since it is so out of date.I have a Nu-Link-Pro which I do not recommend since it's rather slow. The Nu-Link2-Pro has ETM support though spending $150 on that seems a little high given the STLink works pretty well for me.

author: ataradov
author_rank: Super Contributor
timestamp: July 22, 2022, 05:28:52 pm
content: Quote from: ttt on July 22, 2022, 05:21:08 pmNo, I'm not talking about SWD interface for programming the part. This device has (undocumented) peripheral that acts as SWD host and lets you create debuggers/programmer without bit-banging the SWD protocol.And ETM capture lets you capture the trace data from other devices. Again, something that is useful for debuggers.Quote from: ttt on July 22, 2022, 05:21:08 pmI don't care about that. I use my own tool for that (https://github.com/ataradov/edbg).

author: krokodyl1220
author_rank: Contributor
timestamp: July 22, 2022, 09:40:17 pm
content: Do you have any plans for constructing a probe using these peripherals? Any chances for a trace probe for a cost of micro and PCB?

author: ataradov
author_rank: Super Contributor
timestamp: July 22, 2022, 10:40:50 pm
content: I have plans to experiment, for sure. The rest depends on what happens there. If I can get reliable trace capture, then sure. I already have a cheap-ish trace probe design, but the decoding software is incomplete. I don't find trace that useful, so I did not have motivation to finish it once I figured out how ETM it works. Having this device gives me a new motivation, since having a simple trace probe may be useful.I doubt I will ever bother integrating it into IDEs and stuff like that. So, it would be a standalone utility, chaces are just command line at first.

author: josip
author_rank: Regular Contributor
timestamp: July 23, 2022, 06:58:24 am
content: Quote from: ataradov on July 22, 2022, 05:28:52 pmBTW, SWD support by FlexIO is mention in Kinetis familly documentation, but didn't see any examples for this. I guess RP2040 PIO can handle this.

author: ataradov
author_rank: Super Contributor
timestamp: July 23, 2022, 07:12:16 am
content: FlexIO is just a shift register. On that level any MCU with SPI interface supports SWD.

author: girishji
author_rank: Contributor
timestamp: September 21, 2022, 10:31:31 am
content: Is it possible to add DFU capable bootloader on Nuvoton M48x?I have been looking for a small pin count MCU with USB HS device controller and integrated PHY for a small hobby project. I found 2 options: Nuvoton M48x and FTDI FT93x.Regarding Nuvoton, firmware upgrade is only possible through their Nu-Link debugger module. I was wondering if this can be improved (use USB for firmware upgrade). If there is a way to replace their bootloader (which I think is in a bitmask protected area of flash), then DIY people will find it easier to use their MCUs.

author: ataradov
author_rank: Super Contributor
timestamp: September 21, 2022, 03:51:52 pm
content: You can program it though any SWD programmer, they are really cheap and widely available.There is nothing stopping anyone from implementing a DFU bootloader, but I have not made one yet, and I have not looked at anything readily available, since it was not a priority for me.

author: girishji
author_rank: Contributor
timestamp: September 21, 2022, 08:51:56 pm
content: Forgive my ignorance as I have not worked on this type of stuff. I was under the impression that bootloader from factory is not erasable without special tricks. If there are no roadblocks as you say I would like to give this a try. Does programming a new DFU capable bootloader amounts to writing new bootloader to LDRAM using their Nu-Link debug module, and setting appropriate configuration bit to boot from LDROM? Any help appreciated.

author: ataradov
author_rank: Super Contributor
timestamp: September 21, 2022, 08:59:47 pm
content: You can't overwrite factory bootloader, you can only place a new one in the flash. Your application would have to take into account that there is a bootloader.You program that bootloader just like you would program any other application.You don't have to use Nu-Link, any programmer that supports SWD would work. If you have Pi Pico, you can turn that into a programmer.

author: coppice
author_rank: Super Contributor
timestamp: September 21, 2022, 09:13:09 pm
content: Quote from: wraper on July 20, 2022, 02:14:36 pmSome Nuvoton stuff can be pretty obscure, as its just targeted at a handful of key customers, like PC motherboard makers. They produce supporting material with only those people in mind.

author: girishji
author_rank: Contributor
timestamp: September 22, 2022, 07:13:16 am
content: Suppose using SWD is not an option, but can be used only once to program a new DFU bootloader. Suppose the running application has some problem and it cannot be used to trigger DFU bootloader. However, user can press some button (or 2 buttons like on blackpill) on the board itself to trigger reset into DFU bootloader. How do I implement “press this button and mcu will boot into bootloader” part? When you pull down reset pin, it reboots into application. How can I make it boot into DFU bootloader stored in LDROM?Any help appreciated.

author: ataradov
author_rank: Super Contributor
timestamp: September 22, 2022, 04:15:16 pm
content: Quote from: girishji on September 22, 2022, 07:13:16 amWhen you pull down the reset it would run your bootloader. It does not even know where your real application starts. All you need to do is sample the entry pin in the BL and not proceed to execute the application that may be broken.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: September 22, 2022, 08:02:00 pm
content: Quote from: girishji on September 22, 2022, 07:13:16 amThe boot options depend on the part, check the data.eg The N76e003 has a Flash bit CBS (Config Boot Select) that directs what happens on reset-exit.

author: girishji
author_rank: Contributor
timestamp: September 23, 2022, 07:29:20 am
content: Thank you for answering. In the meanwhile I found their Bootloader Manual and it goes through the steps in detail. Yes, by setting CBS bits you can boot from their so called LDROM (bootloader) or APROM (application). Unfortunately, they don’t provide 2 boot pins (BOOT0, BOOT1) like some STM32F4 but the same effect can be achieved through timeouts. This mcu is looking more and more appealing. They even sent me a link to DFU example. I decided to place an order for M487 samples.