PlatformIO Community

[ststm32]Can not upload bin throw the jlink

There is my question, I use STM32L476RG in my personal project, under the macos, the PCB board is designed by myself
iShot2020-04-27下午05.14.57
but based on the Nucleo, here is my ini file:
iShot2020-04-27下午05.02.12

I use the jlink-EDU, when I upload my program always be failed like this:
iShot2020-04-27下午04.56.01

I tried so many times, at last I find a solution, but i think it’s not right,
I open the SEGGER J-Flash Lite and click the Erase Chip button, then I upload the program in VSCODE, and it will be succeed, but I don’t know why? And how it works?
iShot2020-04-27下午05.12.05
Could you help me?

Seems like write protection? https://forum.segger.com/index.php/Thread/4045-SOLVED-STM32L052-failed-to-erase-sectors/?postID=14518#post14518

I note that your are writing to address 0x00000000 with the J-Flash Lite and to address 0x08000000 with PlatformIO/OpenOCD. Depending on the BOOT0 and BOOT1, 0x00000000 can be aliased to 0x08000000 or it can point somewhere else. Could that be the difference? What are the BOOT0 and BOOT1 levels?

thank you for your replay .
boot0 connected 10k resistor to the ground ,and boot1 leave it float

i dont think its the problem

OK
I find the problem, I use the wrong code, the pointer is wrong. Sorry
#include <mod_lora_rak.h>

Mod_LoRa_RAK::Mod_LoRa_RAK(HardwareSerial &_serial, int _pwr_en_pin, int _reset_pin)
{
	*at_serial = &_serial;
	pwr_en_pin = _pwr_en_pin;
	rst_pin    = _reset_pin;

	rssi = 0;
	snr  = 0;

	mod_response = " ";
}

look at the *at_serial, I should change it to at_serial