Defining offset works in .json manifest but not in platformio.ini (stm32 custom board)

I need to keep a bootloader that sits from 0x08000000 to 0x08008000
when I use this platformio.ini

[platformio]    


[env:cube]
platform = ststm32
framework = arduino
board = rumba32_f446ve

upload_protocol = dfu
monitor_speed = 115200

build_flags = 

    -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC

and this .json file

{
  "build": {
    "cpu": "cortex-m4",
    "extra_flags": "-DSTM32F446xx",
    "f_cpu": "180000000L",
    "flash_offset": "0x8000",
    "framework_extra_flags": {
      "arduino": "-DCUSTOM_PERIPHERAL_PINS"
    },
    "mcu": "stm32f446ret6",
    "product_line": "STM32F446xx",
    "variant": "STM32F4xx/F446V(C-E)T"
  },
  "connectivity": [
    "can"
  ],
  "debug": {
    "jlink_device": "STM32F446RE",
    "openocd_target": "stm32f4x",
    "svd_path": "STM32F446x.svd"
  },
  "frameworks": [
    "arduino",
    "cmsis",
    "stm32cube",
    "libopencm3"
  ],
  "name": "3D Printer control board",
  "upload": {
    "maximum_ram_size": 131072,
    "maximum_size": 524288,
    "protocol": "stlink",
    "protocols": [
      "jlink",
      "cmsis-dap",
      "stlink",
      "blackmagic",
      "serial"
    ],
    "offset_address": "0x08008000"
  },
  "url": "https://github.com/Aus3D/RUMBA32",
  "vendor": "RUMBA"
}

it works
but if try to define the offset in the platformio.ini

[platformio]    


[env:cube]
platform = ststm32
framework = arduino
board = rumba32_f446ve


board_build.offset = 0x8000
board_upload.offset_address = 0x08008000

upload_protocol = dfu
monitor_speed = 115200

build_flags = 

    -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
  

and use this .json

{
  "build": {
    "cpu": "cortex-m4",
    "extra_flags": "-DSTM32F446xx",
    "f_cpu": "180000000L",
    "framework_extra_flags": {
      "arduino": "-DCUSTOM_PERIPHERAL_PINS"
    },
    "mcu": "stm32f446ret6",
    "product_line": "STM32F446xx",
    "variant": "STM32F4xx/F446V(C-E)T"
  },
  "connectivity": [
    "can"
  ],
  "debug": {
    "jlink_device": "STM32F446RE",
    "openocd_target": "stm32f4x",
    "svd_path": "STM32F446x.svd"
  },
  "frameworks": [
    "arduino",
    "cmsis",
    "stm32cube",
    "libopencm3"
  ],
  "name": "3D Printer control board",
  "upload": {
    "maximum_ram_size": 131072,
    "maximum_size": 524288,
    "protocol": "stlink",
    "protocols": [
      "jlink",
      "cmsis-dap",
      "stlink",
      "blackmagic",
      "serial"
    ]
  },
  "url": "https://github.com/Aus3D/RUMBA32",
  "vendor": "RUMBA"
}


it doesn’t work.

what am i doing wrong ?
thanks

I want to define the offset from the project folder and not by editing the .json file