Avatar
Dr. Hax
d30ea98ea65e953f91ab93f6b30ea51eb33c506f87d49f600a139aef00aa9511
Cypherpunk. Infosec veteran of about 15 years (vulnerability research, exploit development and cryptography). Cypherpunks write code. :-) Signet maintainer. Self-custody your passwords... in hardware! https://hax0rbana.org/signet Want to see wider adoption so Bitcoin can be used as digital cash and not just an investment vehicle. XMR: 44RDkTFmTeSetwAprJXnfpRBNEJWKvA5dBH5ZVXA4DofgoZ9AgjyZdSa2fo7pMD3Qe3pdKga8X22y3Lyn1xYde5kPQPzVUu

TL;DR I got the debug output from Signet's UART

- The reference manual is well organized!

- I added lots of comments to the code to reference which section of which document that it came from

- I got confused with calculating the UART BR register value for a desired baud rate, but that doesn't really matter because...

- The UART port "just worked" with `screen` on Fedora 38. I'm not sure if I transposed something in the command on my Debian 12 box or if they have different defaults for parity/stop bit, or something else is going on. I'm busy the next few days, but I'll boot that box again to investigate further in a few days

- The reason my previous test was constantly writing to the `screen` was because the debug output is continuous as there are apparently some debug print in the main loop

Overall, this is excellent news. Not only did I get the ability to see runtime debug print statements from the firmware, but I also got familiar with how to find low level information about this MCU.

Plus with the notes I made in the code, next time I'm going through it (or someone else is), it'll be easier to trarck these things down.

nostr:nevent1qqsz39snpjfxaehn2q7qjvatrxg6s0ykp7kruq4x66e74dvwyqqu02qpz9mhxue69uhkummnw3e82efwvdhk6q3q6v82nr4xt62nlydtj0mtxr49r6enc5r0sl2f7cq2zwdw7q92j5gsxpqqqqqqzyycjp5

What's it like programming an MCU? Well, this is the section of the programming manual I'm reading right now:

#m=image%2Fjpeg&dim=701x692&blurhash=%7C5Rysf4-%7Eqj%5Bxuxu%25Mxu%25MWT9F-%3Bj%5Dt7xuWBxuWB00M%7Bxbfk%25MofRjt7ayRjWCM%7Bayj%5BRij%5BWAj%5Bog%25MIUV%5BayM%7Bs%3AWAof%3FbogWBt7M%7BRjWBRiWBxvf8Rjt7WBWBj%5BWBof%25MWCIUayt7j%5BaxWBof4nRjoft7ofWBt7R%25of&x=a17e707768c2509b383d18c1f030e2dccccb5c3192a947e147503234dcd8a7bb

While I was looking for a "reference manual" for the STM32L442KC, I came across an option to buy the MCU directly from the manufacturer. I pay about $8/chip (about $9 after shipping). If I bought direct, $2.67/chip! The catch? I have to order 10,000 of them at once!

So, I'd need to be operating at an enormous scale for that purchase to make sense. $26,700 is a lot of money.

If I were operating at that scale, I could also buy all the other components at a better price per unit, but the main costs are

1. Software and hardware R&D

2. Hardware assembly

3. Parts

In that order, and there's a huge gap in between each one. Still, $5 less in parts, plus getting them direct from the manufacture is still pretty attractive.

Someone defaced this trash can at a busy food hall. Who would do such a thing just to spread a policitcal message?

#m=image%2Fjpeg&dim=1440x1920&alt=A+large+%22vote+for+better+money%22+sticker+is+on+a+trashcan+on+Broadway.&blurhash=_jI%3BXk%7EQj%5DkDWWWDa%7DIWRkt2obococj%3FE3R%3AR.WCa%24WFj%5BShj%3FoIoeayjsayIvRkj%3FWFoJoJf7RkWXkCoIa%7DWXj%5BV%5BR.azj%3Dj%5Bocj%3FbbWVWCa%24aza%7Da%23bbWBf7azo0oJjs&x=77263c696322fbafc04e14698ae6a85f68fccceb537ee452545d5fc9a4684c02

I see references in the comments to AF7 and the code isnsetting af_num to 7, which seems to match. This lines up with pins 19/20 being UART1.

Ohhhh, PA9 and PA10, not literally pins 9 and 10! I think it's starting to come together. Can you feel the excitement?

But why does the comment say USART2 init if it is really initializing UART1? Is it a comment that is wrong? A typo? Maybe they used to use UART2 and then switched to UART1 and just missed updating the comment?

The variable is named usart1, so it feels like a deceptive comment, but what does the code say? Will I be able to confirm it before it's time for the 2600 meeting? We'll see...

No. Also, nostr.cooking isn't mine, I'm just the one who reported the issue.

Replying to Avatar Seth

I have been recommending https://nostrtool.com for the conversion. Will look at options to build into the site

That worked. I was able to gey my nsec, log in, update a recipe and publish it. So I know I am really logged in as the same user.

Thanks for giving some devops time to privacy advocates like me. You're making the internet a nicer place, one step at a time. ❤️

And there's a memory write that goes to a field in that struct that is only ever written and nothing ever reads it.

I'm guessing this is some CPU magic that just knows that when a value is written to that address, it should transmit it over the UART_TX pin.

So now I just have to find the places which interact with this magic struct and somewhere it should show me what the options are for things like baud rate, parity and so forth. Hopefully that will let me determine where I've got something misconfigured.

I'm getting output on the UART pins when I plug in the FT232R, but it's [almost] all gibberish.

Can confirm that as long as I get Cloudflare's permission, I can get to zap.cooking now (over Tor).

Unfortunately, I have some seed words that I'd like to log in with, but the site only accepts nsec, which I do not have and can't find a tool to generate it for me on a mobile phone.