Custom 3xx/4xx "design rules" recommendation

If you made your own board, post here, unless you built a Maple or Maple mini clone etc
Post Reply
User avatar
Pito
Posts: 1627
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Custom 3xx/4xx "design rules" recommendation

Post by Pito » Fri Apr 15, 2016 7:26 am

Hi, a small board with 3xx/4xx is on my todo list since ever :)
After reading this forum I would be happy to better understand following:

1. usb - 1k5 stuff - the switch - does the highside pnp work fine?
2. usb - protection diodes - do we need them?
3. boot0/boot1 - a pull down resistor would be ok? Which of them we actually need?
4. pins - numbering - afik we can map the pins via sw config, so may we escape to headers as we wish?
5. pins - numbering - to use arduino-like numbers (ie D0..D31) or port names (PA0..PA15)?

My idea is a minimalists board in a stamp format.
Pukao Hats Cleaning Services Ltd.

User avatar
RogerClark
Posts: 7459
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Custom 3xx/4xx "design rules" recommendation

Post by RogerClark » Fri Apr 15, 2016 10:08 am

Its best if you pull down both boot0 and boot1, as if you only pull down boot0, and leave boot1 floating, you will have problems if you try to upload via serial etc, as when boot0 is high the processor also reads the state of boot1 to determine boot options

gbulmer
Posts: 67
Joined: Wed Sep 23, 2015 12:04 am
Location: UK

Re: Custom 3xx/4xx "design rules" recommendation

Post by gbulmer » Sun Apr 17, 2016 6:54 pm

There are some tried and tested Maple-compatible alternative board designs at https://github.com/gbulmer/openstm32hw

Their USB is more robust than Maple, with ESD protection, and, IIRC, the simpler version of USB use fewer components and less board space than Maple Mini.

Some of Siy's designs are single sided PCBs, which he DIYed!

My designs, e.g. Orone-mini-v0, use large SMD components to make it easier to DIY.

Several people made Orone-mini-v0 and fitted STM32F303s. Ventosus on leafLabs forum ported some of libmaple to it. Ventosus github repos are at https://github.com/ventosus

jaromir
Posts: 31
Joined: Sat Apr 30, 2016 4:50 pm

Re: Custom 3xx/4xx "design rules" recommendation

Post by jaromir » Sat Apr 30, 2016 5:04 pm

Pito wrote: 1. usb - 1k5 stuff - the switch - does the highside pnp work fine?
Highside P-FET is IMHO cleaner solution. Just like itead did here https://www.itead.cc/iteadmaple.html schematics ftp://imall.iteadstudio.com/IM120411012 ... dmaple.pdf
Pito wrote: 2. usb - protection diodes - do we need them?
Do you mean low-capacitance TVS on data lines?
I use WE devices on professional designs to pass ESD tests and disregard it on homebrew designs. Amount of USB devices zapped by ESD events: 0
https://www.digikey.com/Web%20Export/Su ... ations.pdf
Pito wrote: 3. boot0/boot1 - a pull down resistor would be ok? Which of them we actually need?
You NEED pull down resistors on both lines, otherwise you'll be jumping randomly between boot modes.
It is good idea to add optional jumper or dip-switch to pull BOOT0 high, in order to be able into boot mode, saving headaches from runaway code blocking SWD pins.

User avatar
Pito
Posts: 1627
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Custom 3xx/4xx "design rules" recommendation

Post by Pito » Sat Apr 30, 2016 8:09 pm

Hi Jaromir, nice to you see you here!
Interestingly, I've seen on the schematics to various eagle designs here in this thread the 4xx chips do not use the high side switch at all, and usually have got the 1k5 wired to +3,3V.
Pukao Hats Cleaning Services Ltd.

User avatar
martinayotte
Posts: 1229
Joined: Mon Apr 27, 2015 1:45 pm

Re: Custom 3xx/4xx "design rules" recommendation

Post by martinayotte » Sat Apr 30, 2016 10:11 pm

This means the auto-discovery can be done by software, and that means that we need to unplug/replug USB each times.

User avatar
Pito
Posts: 1627
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Custom 3xx/4xx "design rules" recommendation

Post by Pito » Sat Apr 30, 2016 10:43 pm

Mini64SE board Readme:
Version for F2/F4 uses different ESD protection and lacks
external disconnect cirquitry. These changes are necessary
to enable F2/F4 chips work properly in all supported USB modes
(Device/OTG) and with different powering (self powering and
bus powering).
Pukao Hats Cleaning Services Ltd.

User avatar
RogerClark
Posts: 7459
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Custom 3xx/4xx "design rules" recommendation

Post by RogerClark » Sat Apr 30, 2016 10:55 pm

The minimum you need to do is pull Boot0 high to prevent the STM32 randomly entering its internal Serial bootloader, when the board is powered up

The Maple Mini only pulls Boot0 low, and leaves Boot1 floating, and this works Ok as it comes pre installed with the Maple bootloader.

However its a pain to reflash the Maple mini via serial, because when you press the button to pull Boot0 low, Boot1 is still floating and is randomly High or Low, and this effects the serial bootloader.

Probably.... weakly pulling Boot1 high, e.g via 22k ( or higher) would still allow you to use the Boot1 as GPIO

stevech
Posts: 441
Joined: Thu Aug 27, 2015 6:32 am

Re: Custom 3xx/4xx "design rules" recommendation

Post by stevech » Sat Apr 30, 2016 11:37 pm

RogerClark wrote:The minimum you need to do is pull Boot0 high to prevent the STM32 randomly entering its internal Serial bootloader, when the board is powered up

The Maple Mini only pulls Boot0 low, and leaves Boot1 floating, and this works Ok as it comes pre installed with the Maple bootloader.

However its a pain to reflash the Maple mini via serial, because when you press the button to pull Boot0 low, Boot1 is still floating and is randomly High or Low, and this effects the serial bootloader.

Probably.... weakly pulling Boot1 high, e.g via 22k ( or higher) would still allow you to use the Boot1 as GPIO
Isn't BOOT0 supposed to be grounded (0) at power up to disable the factory bootloader? That's what I've used, and how I read the ST ref. manuals. BOOT0=1 means use SYSTEM memory which is the factory bootloader remapped to address 0 at power up/reset.

To get into the factory bootloader after reset, say, when your app wants to do so, there is an ST register to remap and then you load the SP and jump through the bootloader. I used that in my app which does the jump to bootloader if I jumper a UART TX and RX together to enable this "rescue" mode. The factory bootloader in the STM32F4xx automatically finds the baud rate for UART1, UART3, CAN, I2C and USBOTG/DFU. It is clever enough to detect which one is being used. The lower end STM32's have fewer options in the bootloader interfaces.

User avatar
RogerClark
Posts: 7459
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Custom 3xx/4xx "design rules" recommendation

Post by RogerClark » Sun May 01, 2016 1:41 am

Yes.

My bad...

Boot0 should be Low not high.

Which is probably why leaving Boot1 is a problem when Boot0 is driven high (eg by a link) as Boot1 probably has a tendency to float high and cause the Serial bootloader to load the code into RAM.


I don't know the details of how the sketch jumps to the bootloader start, as didnt write libmaple. I didn't write the bootloader either.. I just ran with them both, as the were both orphaned by Leaflabs.

Post Reply