STM32H743 general VLAN handling not working as described
I am currently implementing a Profinet protocol on the STM32H743 which needs VLAN information in some packet types. Since the VLAN tags are already generated by the software for transmit packets I tried to get these tags passed through the Ethernet MAC. The reference manual (Rev 8, page 2973f) suggest that when setting the VLP flag (Bit 18) a 0 in the VLC would let the VLAN tags pass through the MAC. However, this is not the case. VLC=0, VLC=1 and VLC=3 all cause the deletion of a VLAN tag prepared by the software and these will not be seen on the network. Only VLP=1 & VLC=2 seems to allow the passing of the VLAN Tag, however none of these settings replaces (parts) the prepared VLAN tags as documented for VLP=1 & VLC=2. I could confirm this with the help of Wireshark logs. When VLP=0 all prepared VLAN tags are deleted by the MAC.
For me, the following register settings let pass prepared VLAN tags through the MAC:
- MACVTR=0x04000000
- MACVIR=0x006000000
- MAVIVIR=0x007000000
This should be investigated by the STM32H7 support crew and probably end up in the errata sheet.
I am aware that other software developpers use the transmit descriptor ring VLAN handling capabilities together with the VLTI bit 20 in MACVIR in order to solve the VLAN handling problem. However, the resulting software solution looks rather cumbersome as compared to the generation of the VLAN tags by the protocol software during the paket generation. When I look at the software using the transmit descriptors for VLAN handling I get the idea that there are further errata in this area to be investigated and document.