Manufacturing Design Checklist


I had to stop because the account has no available ACUs, so AI tool execution is unavailable right now.
What I completed this session:
  • Ran routing pre-check; broad autoroute is not safe yet due to blocked pins and track-width warnings.
  • Routed several targeted power paths:
    • PS1 +VDC → C1 P1 on ISO_24V
    • C1 P1 → F1 P1 on ISO_24V
    • F1 P2 → Q10 source on 24V_FUSED
    • Q10 drain → J2 pin 1 on 24V_OUT
    • Q1 source → C1 P2 on ISO_GND
    • F1 P2 → U5 IN
    • C1 P1 → U1 VIN
    • U1 VIN → U1 EN
Open items:
  • I could not run the final post-route DRC due to ACUs running out.
  • These routes failed and still need attention:
    • J2 pin 2 → Q1 drain LED switched return
    • U5 OUT → Q10 drain
    • Q10 gate → U5 GATE
Suggested next steps:
  1. Add ACUs, then run one DRC check.
  2. Manually inspect Q1/Q10/U5 local placement and copper clearance.
  3. Route the three failed local connections surgically before any broader routing.
bruh you didn't even wire it together and created more issues

Screenshot 2026-07-04 at 4.41.38 PM

You’re right. I checked history: the bad work is exactly 8 routing commits from my last pass, and they can be cleanly reverted without touching your earlier manual move or the C1/property fixes.
Safe recovery point:
  • Revert to commit #bd42c4c0
  • This removes only the 8 bad mutate_layout_route edits.
  • It preserves your prior layout changes and the C1 footprint/property work.
I will not do anything else unless you approve. If you want me to undo the damage, say:
Revert to #bd42c4c0
Revert bad routes
Show route diff
Revert and run DRC
Protect current state
Manual routing plan

Waiting for input


Firmware Starter — STM32G473 + W5500 PoE Lighting Controller
Platform & Toolchain
  • MCU: STM32G473 LQFP64 (U2)
  • Ethernet controller: WIZnet W5500 (U3) over SPI1
  • Framework: STM32 HAL / STM32CubeIDE or PlatformIO STM32Cube
  • Logic rail: 3V3
Pin Mapping

Table


FunctionMCU PinNetConnected ToNotes
SPI Ethernet CSPA4SPI1_ETH_CSU3 ~SCSActive low
SPI Ethernet SCKPA5SPI1_SCKU3 SCLKSPI1 clock
SPI Ethernet MISOPA6SPI1_MISOU3 MISOW5500 to MCU
SPI Ethernet MOSIPA7SPI1_MOSIU3 MOSIMCU to W5500
Ethernet interruptPA3ETH_INTU3 ~INTActive low
Ethernet resetPA2ETH_RSTU3 ~RSTActive low; pulled up by R10
PWM dimmingPA8LED_PWMR15 -> Q1 gateTimer PWM output
I2C SCLPC6I2C_SCLJ3 SCL, R12I2C lux header
I2C SDAPC7I2C_SDAJ3 SDA, R11I2C lux header
PIR inputPB1PIR_INR13/R14/C32/J4Filtered GPIO input
SWDIOPA13SWDIOJ5 pin 2Debug
SWCLKPA14SWCLKJ5 pin 4Debug
ResetPG10/NRSTNet 2 / reset networkJ5 pin 5, R4, C20Reset net should be renamed to MCU_NRST later
SWOPB3SWOJ5 pin 6Optional trace output
BOOT0PB8MCU_BOOT0R5 to GNDNormal flash boot
platformio.ini

Ini


[env:stm32g473]
platform = ststm32
board = nucleo_g474re ; closest dev-board target; adjust to exact STM32G473 package/project in CubeMX
framework = stm32cube
upload_protocol = stlink
debug_tool = stlink
monitor_speed = 115200
Starter main.c

C


#include "main.h"
#include <string.h>
#include <stdint.h>

SPI_HandleTypeDef hspi1;
I2C_HandleTypeDef hi2c4;
TIM_HandleTypeDef htim1;

#define ETH_CS_GPIO_Port GPIOA
#define ETH_CS_Pin       GPIO_PIN_4
#define ETH_RST_GPIO_Port GPIOA
#define ETH_RST_Pin       GPIO_PIN_2
#define ETH_INT_GPIO_Port GPIOA
#define ETH_INT_Pin       GPIO_PIN_3
#define LED_PWM_GPIO_Port GPIOA
#define LED_PWM_Pin       GPIO_PIN_8
#define PIR_GPIO_Port     GPIOB
#define PIR_Pin           GPIO_PIN_1

static void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_SPI1_Init(void);
static void MX_I2C4_Init(void);
static void MX_TIM1_Init(void);

static void w5500_reset(void) {
    HAL_GPIO_WritePin(ETH_RST_GPIO_Port, ETH_RST_Pin, GPIO_PIN_RESET);
    HAL_Delay(2); // W5500 requires >=500 us reset low
    HAL_GPIO_WritePin(ETH_RST_GPIO_Port, ETH_RST_Pin, GPIO_PIN_SET);
    HAL_Delay(2);
}

static uint8_t w5500_read_version(void) {
    uint8_t tx[4] = {0x00, 0x39, 0x00, 0x00}; // VERSIONR address 0x0039, common register block, read
    uint8_t rx[4] = {0};
    HAL_GPIO_WritePin(ETH_CS_GPIO_Port, ETH_CS_Pin, GPIO_PIN_RESET);
    HAL_SPI_TransmitReceive(&hspi1, tx, rx, sizeof(tx), 100);
    HAL_GPIO_WritePin(ETH_CS_GPIO_Port, ETH_CS_Pin, GPIO_PIN_SET);
    return rx[3]; // Expected W5500 version is commonly 0x04
}

static void set_pwm_percent(uint8_t pct) {
    if (pct > 100) pct = 100;
    uint32_t arr = __HAL_TIM_GET_AUTORELOAD(&htim1);
    __HAL_TIM_SET_COMPARE(&htim1, TIM_CHANNEL_1, (arr * pct) / 100);
}

int main(void) {
    HAL_Init();
    SystemClock_Config();
    MX_GPIO_Init();
    MX_SPI1_Init();
    MX_I2C4_Init();
    MX_TIM1_Init();

    HAL_GPIO_WritePin(ETH_CS_GPIO_Port, ETH_CS_Pin, GPIO_PIN_SET);
    w5500_reset();
    uint8_t version = w5500_read_version();
    (void)version;

    HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1);
    set_pwm_percent(10);

    while (1) {
        GPIO_PinState occupied = HAL_GPIO_ReadPin(PIR_GPIO_Port, PIR_Pin);
        set_pwm_percent(occupied == GPIO_PIN_SET ? 80 : 10);
        HAL_Delay(250);
    }
}

static void MX_GPIO_Init(void) {
    __HAL_RCC_GPIOA_CLK_ENABLE();
    __HAL_RCC_GPIOB_CLK_ENABLE();
    __HAL_RCC_GPIOC_CLK_ENABLE();

    GPIO_InitTypeDef GPIO_InitStruct = {0};

    HAL_GPIO_WritePin(ETH_CS_GPIO_Port, ETH_CS_Pin, GPIO_PIN_SET);
    HAL_GPIO_WritePin(ETH_RST_GPIO_Port, ETH_RST_Pin, GPIO_PIN_SET);

    GPIO_InitStruct.Pin = ETH_CS_Pin | ETH_RST_Pin;
    GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

    GPIO_InitStruct.Pin = ETH_INT_Pin;
    GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
    GPIO_InitStruct.Pull = GPIO_PULLUP;
    HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

    GPIO_InitStruct.Pin = PIR_Pin;
    GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
}

static void MX_SPI1_Init(void) {
    __HAL_RCC_SPI1_CLK_ENABLE();
    hspi1.Instance = SPI1;
    hspi1.Init.Mode = SPI_MODE_MASTER;
    hspi1.Init.Direction = SPI_DIRECTION_2LINES;
    hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
    hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
    hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
    hspi1.Init.NSS = SPI_NSS_SOFT;
    hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8;
    hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
    HAL_SPI_Init(&hspi1);
}

static void MX_I2C4_Init(void) {
    __HAL_RCC_I2C4_CLK_ENABLE();
    hi2c4.Instance = I2C4;
    hi2c4.Init.Timing = 0x10D19CE4; // placeholder 100 kHz timing; regenerate in CubeMX for final clock tree
    hi2c4.Init.OwnAddress1 = 0;
    hi2c4.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
    hi2c4.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
    hi2c4.Init.OwnAddress2 = 0;
    hi2c4.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
    hi2c4.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
    HAL_I2C_Init(&hi2c4);
}

static void MX_TIM1_Init(void) {
    __HAL_RCC_TIM1_CLK_ENABLE();
    htim1.Instance = TIM1;
    htim1.Init.Prescaler = 169;
    htim1.Init.CounterMode = TIM_COUNTERMODE_UP;
    htim1.Init.Period = 999;
    htim1.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
    HAL_TIM_PWM_Init(&htim1);

    TIM_OC_InitTypeDef sConfigOC = {0};
    sConfigOC.OCMode = TIM_OCMODE_PWM1;
    sConfigOC.Pulse = 0;
    sConfigOC.OCPolarity = TIM_OCPOLARITY_HIGH;
    sConfigOC.OCFastMode = TIM_OCFAST_DISABLE;
    HAL_TIM_PWM_ConfigChannel(&htim1, &sConfigOC, TIM_CHANNEL_1);
}

static void SystemClock_Config(void) {
    // Generate final clock setup in STM32CubeMX for STM32G473.
    // Current schematic uses internal HSI; no STM32 external HSE crystal is populated.
}
Build & Flash
  1. Connect ST-LINK to J5: 3V3, GND, SWDIO, SWCLK, NRST.
  2. Build in STM32CubeIDE or PlatformIO.
  3. Confirm W5500 version register returns 0x04 before enabling network stack.
  4. Add a W5500 driver/library and lux sensor driver once the exact lux sensor module is chosen.
  • Platform & Toolchain

  • Pin Mapping

  • `platformio.ini`

  • Starter `main.c`

  • Build & Flash