|
Forseti posted:I don't think any of the Cortex-Ms have an MMU. Some have a memory protection unit and/or "execute in place" capability for external flash/SRAM.
|
# ? Jun 1, 2020 00:07 |
|
|
# ? Jun 12, 2024 14:47 |
|
No worries, marketing departments muddy the waters on that quite a bit. Like the ESP32 straight up says it has an MMU in the datasheet, but it's also more of a protection unit and doesn't have the features needed for the non-ucLinux version of the Linux kernel. I wish I actually knew something about Rust and could help you with your problem but to be honest I'm not totally sure what you're trying to do in the first place . It sounds like you're writing something akin to C's 'sprintf'? What display are you writing for, is it like an SPI/I2C display? Because a lot of times those have a frame buffer on the controller itself. Sometimes the boards don't break out the pins needed to read it back though. This dude actually used his display's memory to extend his program memory: https://ioprog.com/2020/05/19/breadboard-games-2020/
|
# ? Jun 1, 2020 00:23 |
|
That's a neat hack. I'm using a SPI 400x300px 4.2" e-paper device. There's enough memory on the STM32 to put the whole frame buffer in memory, although there are tricks about dividing it into sub-displays if needed to use on memory-constrained devices. This type of display has has some tricks involved if you don't want to have it flash the screen white/black/white and take 5s to refresh, and if you abuse them, it causes burn-in. Working through some of those now to try to make it more responsive. Using a HAL lib to make it happen. The formatting code is nothing too fancy. In effect, it's similar to `sprintf`, but the API's awk to it modifying buffers in place instead of returning. And you have to guess at the buffer size. (Depending on decimal precision, and how much you expect the number to vary. I could probably fix the former, but the naive approach results in compile errors) Rust code:
Dominoes fucked around with this message at 01:03 on Jun 1, 2020 |
# ? Jun 1, 2020 00:59 |
|
Yeah I was thinking "why not use sprintf" but didn't know anything about rust so assumed I might be missing something dumb. What's wrong with this picture? Nothing? I didn't see anything either for the whole day as I was tracking down a problem. But see that Ground on pin 14? Turns out it's connected to pin 3 on this 74HC245 octal transceiver, which is an i/o pin. Connecting and setting it up appropriately solved everything. So just a PSA not to trust Chinese silkscreen and double check (non-existent) datasheets or at least probe the circuit if something looks suspicious.
|
# ? Jun 1, 2020 01:04 |
|
mobby_6kl posted:Yeah I was thinking "why not use sprintf" but didn't know anything about rust so assumed I might be missing something dumb. Rust code:
Rust code:
Dominoes fucked around with this message at 01:11 on Jun 1, 2020 |
# ? Jun 1, 2020 01:09 |
|
Hey, I think I have the same e-paper display! Waveshare? The controller is actually on the screen part (chip-on-glass) so you should be able to replicate what's on the board without much trouble. Applied Science actually scraped off the stuff around it so he could probe it on a similar model but you might have already watched this very video if you're looking at faster refreshes: https://www.youtube.com/watch?v=MsbiO8EAsGw&t=1148s
|
# ? Jun 1, 2020 01:35 |
|
Nailed it! I watched that vid a few days ago. Helped in getting the quickrefresh working. I've been exchanging emails with a guy who patched the HAL lib about the best way to make this work fast. I'm going to try to patch his patch to make it work without streaming. I have one of the black/white/red panels around too with no board. Curious if I could make it work with the Waveshare board. I've done various experimenting today about what operations will trigger faster/slower operation. The dude in the video has a sick 3hz animation. I don't need it that fast, but the full refresh is unsat if it's every time. I've also tuned the code pretty specifically for my use to minimize refreshes. My display code's now a clusterfuck of sub-displays. Quick-refreshing one is much faster than doing the whole thing (Fine for my use), but am getting artifacts on the other parts of the screen when I do this. You can get the screens with no board cheap on Alibaba. Dominoes fucked around with this message at 01:46 on Jun 1, 2020 |
# ? Jun 1, 2020 01:41 |
|
Dominoes posted:But you have to enable an allocator first. Cortex-m has one Nitpicking here but it’s a distinction that your previous posts have seemed a bit hazy on in the past: The Cortex-M architecture doesn’t “have an allocator,” the standard library you’re building with that targets Cortex-M has an allocator that you can optionally enable and use. The specific microcontroller you’re using may have hardware features that make writing an allocator easier (like an MMU which can manage paging and create an abstract heap area) but that in and of itself is not an allocator. An allocator is a software feature that enables heap usage, expressed as calls like “malloc” and “new” in C and C++.
|
# ? Jun 1, 2020 01:53 |
|
I appreciate the clarification. I need to read up more on this stuff. (Or stay away as long as I can get away with)
|
# ? Jun 1, 2020 02:02 |
|
The MPU in Cortex-M is used for setting certain memory regions as read-only, no-execute, etc. Very useful since any violation immediately triggers the MemManage interrupt and sets registers which tell you the address of both the illegal access and the instruction. Good debuggers can automatically catch the interrupt and do the fault analysis for you which is a great help. Hopefully this is less necessary when using Rust though!
|
# ? Jun 1, 2020 02:24 |
|
https://twitter.com/53Tedhu/status/1267366230500864004
|
# ? Jun 3, 2020 07:54 |
|
Hey guys, got an especially stupid question for you all. I recently picked up an ESP32-WROVER-KIT development board... And promptly realized it's double sided when it arrived. Anybody here have any recommendations on how to physically mount it while I'm working on it to avoid physically stressing the various components? Am I actually supposed to get some L brackets and try to hold it at a 90 degree angle to my desk if I want access to the pins on each side? Those screw holes seem a little flimsy and small for that, but I'm no mechanical engineer.
|
# ? Jun 3, 2020 21:07 |
|
Something like a http://www.stickvise.com/ or https://www.panavise.com/ is ideal. Alternately you can find some little standoffs and screw it into a board (perhaps...dare I say...a breadboard), or just tape it down if you're real ghetto
|
# ? Jun 3, 2020 21:48 |
|
We used to use pieces of the really dense resin sheets that we made microscope bases from where I worked before. Drilled and tapped and then standoffs installed with the boards attached to the standoffs and rubber feet on the bottom of the resin. It worked really well, the weight was great for keeping it from sliding around the desk when plugging in cables or manipulating the buttons. Not sure what it was made from but I suspect some sort of phenolic resin? If someone has a good idea what it is, I'd love to know so I can get some myself honestly. You can see it in this picture.
|
# ? Jun 3, 2020 22:34 |
|
So I think I'm pretty close to the first prototype board. Since the schematic I got rid of one cap and changed some pin assignments mostly. Turns out all the pin names I set up didn't translate into net names so that was a pain in the rear end. There are some constraints on the physical layout and pin mappings which could some of the questionable choices, and I'm aware of a couple problems, but it'd be great if anyone spots anything else particularly dumb. I can't get it to recognize pin 4 on the voltage regulator as the output like pin 2 C4 and C5 are supposed to be as close as possible to the input and that might not be close enough, so I'll try to shuffle things around a bit. The USB connector footprint violates the default clearance rules but I don't think there's anything I could do about that. Also the back side isn't happening since I can (hopefully) only make single-sided boards for now. inkmoth posted:Hey guys, got an especially stupid question for you all. I recently picked up an ESP32-WROVER-KIT development board... And promptly realized it's double sided when it arrived. Anybody here have any recommendations on how to physically mount it while I'm working on it to avoid physically stressing the various components? Am I actually supposed to get some L brackets and try to hold it at a 90 degree angle to my desk if I want access to the pins on each side? Those screw holes seem a little flimsy and small forW that, but I'm no mechanical engineer. You wouldn't have this problem with knockoff $2 aliexpress boards
|
# ? Jun 3, 2020 22:45 |
|
Thanks guys. No clue how I've made it this far without realizing that circuit board vises are a thing. That stickvise is certainly cool, but I decided to get a PanaVise 324 set since it seems like a good tool to have on hand for both working with this devkit (albeit overkill) and all my future projects!
|
# ? Jun 3, 2020 22:55 |
|
You need to break out IO0 and RST (sometimes called ESP_EN) as well, otherwise you're not going to be able to program it. Also that footprint of LDO is inconsistent with the metal tab. Leave it unconnected, like you have. Some parts use it as ground, some as output voltage, so it'll gently caress you up.
|
# ? Jun 3, 2020 22:55 |
|
It looks like you're counting on the USB port's shield to be connected to ground? That isn't actually the case, it's supposed to be connected to the chassis-ground and probably is not internally connected to the ground pin of the USB port (it's not supposed to be but I wouldn't promise that all ports you can buy actually don't have it connected somehow).
|
# ? Jun 3, 2020 23:03 |
|
ante posted:You need to break out IO0 and RST (sometimes called ESP_EN) as well, otherwise you're not going to be able to program it. Huh, didn't know this was an issue with LDOs, the one I have has it as output, like pin 2. The problem is getting to the middle pin without using another layer, I guess I could try routing it under the package or maybe flipping the LDO. Forseti posted:It looks like you're counting on the USB port's shield to be connected to ground? That isn't actually the case, it's supposed to be connected to the chassis-ground and probably is not internally connected to the ground pin of the USB port (it's not supposed to be but I wouldn't promise that all ports you can buy actually don't have it connected somehow). Thanks in any case, I'm pretty sure this saved me at least one board revision
|
# ? Jun 3, 2020 23:44 |
|
Forseti posted:We used to use pieces of the really dense resin sheets that we made microscope bases from where I worked before. Drilled and tapped and then standoffs installed with the boards attached to the standoffs and rubber feet on the bottom of the resin. It worked really well, the weight was great for keeping it from sliding around the desk when plugging in cables or manipulating the buttons. Not sure what it was made from but I suspect some sort of phenolic resin? If someone has a good idea what it is, I'd love to know so I can get some myself honestly. You can see it in this picture. There's probably a product you can buy but I've seen a couple of articles on hackaday of people making their own epoxy resin granite bases: https://hackaday.com/2017/03/27/casting-machine-bases-in-composite-epoxy/ https://www.adambender.info/post/2017/03/25/epoxy-granite-machine-frame-how-to https://hackaday.com/2016/05/01/precision-cnc-with-epoxy-granite/
|
# ? Jun 4, 2020 00:10 |
|
Edit: ^^^ Wow, that is an in depth blog post! Good stuff, thanks! I learned that because I made the same assumption before too, glad to help! It's easy to mistake because the grounds should all be tied together at some point so it should show continuity if you test one on a device. Forseti fucked around with this message at 00:28 on Jun 4, 2020 |
# ? Jun 4, 2020 00:16 |
|
inkmoth posted:Hey guys, got an especially stupid question for you all. I recently picked up an ESP32-WROVER-KIT development board... And promptly realized it's double sided when it arrived. Anybody here have any recommendations on how to physically mount it while I'm working on it to avoid physically stressing the various components? Am I actually supposed to get some L brackets and try to hold it at a 90 degree angle to my desk if I want access to the pins on each side? Those screw holes seem a little flimsy and small for that, but I'm no mechanical engineer. for supporting + fixturing basically any part with challenging geometry, i l love polycaprolactone (PCL), a low-melt-temp thermoplastic that's nylon-rigid at room temp but softens puttylike when submerged in boiling water. costs about $20 a pound, which is plenty for this sort of thing, but you can basically reuse it indefinitely so it goes far. i've mostly used it to support delicate metalworked goods for engraving or chasing but it transfers over to this sort of thing as well. Just heat up a big lump of it, let it cool a bit so it won't adhere to the PCB or extrude much into any sockets/holes, and then press the board into it until there's plastic supporting the low areas of the board. you'll get a custom jig that you can pop the board in and out of as needed. once you're done with it for good or need the plastic for something else, drop the jig back into boiling water and you can rework it 10 minutes later. PCL is also great for making simple mechanical components on the fly as needed, stuff like standoffs, couplers, bases, entire enclosures, knobs, as well as for potting components/insulating assemblies, you can even mould some around an LED to give it a diffuser. i'm currently expecting to make myself a AA battery holder using some, i'll bend the terminal contacts up from heavy bare copper wire and directly embed it within the mass of plastic during forming before it cools. i can't recommend buying some enough, nobody starts out -needing- the stuff but once it's in your possession you start realizing it's a viable solution to like half of all possible mechanical challenges you're likely to encounter working with electronics Ambrose Burnside fucked around with this message at 04:07 on Jun 4, 2020 |
# ? Jun 4, 2020 03:51 |
|
e: quote, it ain't edit, who knew ive been posting about PCL this past week in the 3d printing thread b/c had a breakthrough and dramatically improved its ease of use by blending the plastic with graphite to make it directly microwaveable. here's a few of the relevant highlights: Ambrose Burnside posted:this belongs in this thread, and yet it does not: Ambrose Burnside posted:yeah i'm surprised it isn't a more widely-known trick, this is the only place i've seen it used https://www.instructables.com/id/Engineering-Putty-Microwavable-InstamorphShapelock/ this one's specifically replying to talk about making tooling/dies with PCL: Ambrose Burnside posted:PCL is fun because it's a completely new design paradigm, it ~~~frees your mind man~~~. with heat-critical tooling, for example- don't have to fear a little heat, just manage it. embed a tubing loop in the die body underneath the inside face of the die before taking the impression, and use a lil pump to circulate coolant through it in use. run parts all day without needing to let the dies rest in the freezer every few parts. or keep it simpler with heatsinks- instead of a coolant loop, embed an aluminium plate or spare heatsink, give your die every passive cooling advantage you can. if you specifically want to do 'hot' casting in PCL dies, even for very modest definitions of 'hot', i'd plan around the best possible cooling from the get-go, it's not like it's difficult or tedious to implement when it's basically like playing with glorified modelling clay. PCL has poor thermal conductivity so to avoid heat-related tool damage id embed any such heat management tool close to the die inner surface, especially infiltrating any die components with a lot of surface area, fine surface detail you need to preserve, or any areas which protrude significantly into the die void and which will be surrounded by molten wax on several sides. pulling the cast parts ASAP after casting is also important, but i wouldn't rely on that to avoid tool damage unless you're making a single duplication or w/e tl;dr: buy some PCL plastic, also known as Shapelock/Instamorph/Polymorph/Protoplastic etc etc. you won't regret it Ambrose Burnside fucked around with this message at 04:02 on Jun 4, 2020 |
# ? Jun 4, 2020 03:58 |
|
inkmoth posted:Hey guys, got an especially stupid question for you all. I recently picked up an ESP32-WROVER-KIT development board... And promptly realized it's double sided when it arrived. Anybody here have any recommendations on how to physically mount it while I'm working on it to avoid physically stressing the various components? Am I actually supposed to get some L brackets and try to hold it at a 90 degree angle to my desk if I want access to the pins on each side? Those screw holes seem a little flimsy and small for that, but I'm no mechanical engineer. I would just sandwich it in male-female standoffs and flip it when I wanted to probe on the back, but I'm lazy.
|
# ? Jun 4, 2020 04:46 |
|
mobby_6kl posted:So I think I'm pretty close to the first prototype board. Since the schematic I got rid of one cap and changed some pin assignments mostly. You are etching it yourself and that's why you can't put copper on the back? To make kicad know that two pins are the same net, give them the same pin number: Run your unused IO pins out to pads where there's room so you can jumper to them if you need to rework it
|
# ? Jun 4, 2020 04:55 |
|
inkmoth posted:Hey guys, got an especially stupid question for you all. I recently picked up an ESP32-WROVER-KIT development board... And promptly realized it's double sided when it arrived. Anybody here have any recommendations on how to physically mount it while I'm working on it to avoid physically stressing the various components? Am I actually supposed to get some L brackets and try to hold it at a 90 degree angle to my desk if I want access to the pins on each side? Those screw holes seem a little flimsy and small for that, but I'm no mechanical engineer. I would just hot glue it to whatever, but I am extremely lazy Ambrose Burnside posted:e: quote, it ain't edit, who knew Holy poo poo
|
# ? Jun 4, 2020 07:36 |
|
ante posted:I would just hot glue it to whatever, but I am extremely lazy here’s some decent resources for the stuff- a good primer on how to work with it, some electronics-specific applications, and experimenting with material compatibility \ bondability https://www.robotroom.com/Prototype-Plastic.html this rounds up some more well-finished + pro-lookin mechanical projects, like a toggle-locking adjustable ball-joint camera mount for bike handlebars, or a servo-driven cam actuator + custom mount for a kite-launched camera https://www.instructables.com/id/DIY-Material-Guide%253a-Polymorph-Plastic--a-thermal-/
|
# ? Jun 4, 2020 17:19 |
|
Foxfire_ posted:You are etching it yourself and that's why you can't put copper on the back? Looks like the problem with the LDO was that pin 4 wasn't specified at all in the schematic so it didn't match with the footprint. Good idea with the extra pins, I already know I'd definitely want to hook up more stuff in the future so I might as well make them available now. Looks pretty good but goddamn that's a lot of tiny holes to drill. I guess I now have to make a drill press out of my dremel?? I went with smd components to minimize that but there's no escaping the headers and connectors. Gonna do another test on the breadboard and then try to make the board it this weekend. Ambrose Burnside posted:heres some decent resources for the stuff-
|
# ? Jun 4, 2020 19:47 |
|
You should be able to find 0.1" headers and USB connectors in SMT. They'll be a little bigger on the top layer and physically weaker.
|
# ? Jun 4, 2020 20:05 |
|
You can get SMT connectors and headers if you want. For example Samtec makes a few types of SMT headers. They are nice with the samples, too.
|
# ? Jun 4, 2020 20:07 |
|
May as well get used to drilling
|
# ? Jun 4, 2020 20:33 |
|
If you're etching just stick to single sided if you can, double sided is considerably more of a pain to do because you have to ensure that the layers are actually aligned to each other. As for drilling I think it's much easier to freehand it then to use a press. Just get a feel for not applying sideways pressure. Big Clive is usually right about things: https://www.youtube.com/watch?v=CrdheP3Dwyc&t=1220s But yeah, go surface mount when you can, the bigger ones are pretty easy to solder anyway and definitely easier than drilling a bunch of holes. Also I like Sodium Persulfate as an etchant. Ferric chloride works well but it stains everything horribly and you can't see the board very well while it's being etched. Downside of Sodium Persulfate though is that you want to keep it warm enough that it's not horribly slow but not so warm that it's causing bubbles to form. It's not too bad though (I just use stacked plastic takeout containers with the lower one containing hot water). I also really like the idea of Big Clive's plastic tubing technique for etching but I haven't gotten around to trying it yet myself. It looks like a huge improvement over an open tray though: https://www.youtube.com/watch?v=w72YCqXt-qA&t=495s
|
# ? Jun 4, 2020 20:49 |
|
I would never use chemicals anymore. CNCing isn't bad when you have the process dialed in, but chemicals are dirty in both the physical and the environmental sense, and time consuming and error prone, and a huge pain in the rear end. Instead of setting up your poo poo, etching, and cleaning up for six hours, it's more worth my time to spend the $14 to get a board professionally made and work on other projects for the three weeks before it arrives.
|
# ? Jun 4, 2020 21:12 |
|
I think etching is fun in a weird kinda-frustrating hobby sort of way, the same way some people like to beat a videogame real fast or build tiny ultra-detailed miniature buildings for their model trains to drive around next to. But yeah there's absolutely no reason to do it these days unless you really, really want to. At least I've gotten enough practice that I can usually be pretty clean with it (or at least confine any spills to a plastic tub I have) and I carefully neutralize and save all the spent etchant so I don't dump copper salts down the drain and kill all the fish.
|
# ? Jun 4, 2020 21:30 |
|
Yeah I wouldn't do it as a business process but I enjoy it for hobby purposes. I'd also rather deal with disposing chemicals properly (as noted, copper ions are the big nasty here) than keeping fiberglass dust from milling under control personally.
|
# ? Jun 4, 2020 21:36 |
|
^^^ This definitely feels like it will be too much of a pain in the rear end for production, but I wanted to test something ASAP. If it actually works I could then order the real thing, but my last package from China took like 2.5 months so I'm still not particularly optimistic about that right now. taqueso posted:You can get SMT connectors and headers if you want. For example Samtec makes a few types of SMT headers. They are nice with the samples, too. Foxfire_ posted:You should be able to find 0.1" headers and USB connectors in SMT. They'll be a little bigger on the top layer and physically weaker. ante posted:I would never use chemicals anymore. I'm certainly not against the idea but that's a whole other can of worms I'd rather not touch now.
|
# ? Jun 4, 2020 22:09 |
|
mobby_6kl posted:^^^ DHL is an option, I got my last order from JLC PCB in about 3 business days from when they shipped it about 2 weeks ago, same with LCSC. It cost ~$15 in shipping both times but definitely beats waiting for months in a lot of cases.
|
# ? Jun 4, 2020 22:38 |
|
PCBWay has been really consistent with 2-3 weeks ~$15 including shipping for me, which is mindblowing
|
# ? Jun 4, 2020 22:43 |
|
I had PCBway build and assemble some prototypes recently for work. They did a great job but they were about a week late with all the shipping mayhem (I'm in Australia). I had a 128 ball BGA on one board and the other was flex rigid. Both boards came out fine, I'm impressed.
|
# ? Jun 4, 2020 23:36 |
|
|
# ? Jun 12, 2024 14:47 |
|
Same experience with Forseti with JLC, to SE USA. About 1 week order to ship, including SMT assembly. 3-4 days transit time.
|
# ? Jun 4, 2020 23:48 |