This is the 17th day of my participation in the August Text Challenge.More challenges in August
The simulation error is error30220
Sometimes errors are reported when using STVD software to simulate programs. A warning window for Error30220 is displayed.
The reason for this problem may be that the burning software STVP software has just burned the program, and STLINK is occupied by the burning software. At this time, you can turn off the burning software STVP, and then re-simulate it, and it can be used normally. If that doesn’t work, unplug the STLINK writer and shut down the software. Restart the software and connect to the writer burner.
Error writing program
Sometimes burning programs will prompt you to save a file in RAM
This is because the program has been burned inside the film, and this time when the program is burned, it is possible to click on the third button (circled), burned with the second folder icon button. In addition, when writing, we should pay attention to whether the chip model is correct.
It won’t burn into the program
Sometimes when you burn a program, it will tell you that the program can’t burn.
First, check whether the chip model and writer are correctly selected. In configure, select Configure ST Visual Programmer.
Then select ST-Link in Hardware, USB in Port, SWIM in Programming Mode, and SINGLE chip computer model in Device.
If everything is set up correctly, but you can’t successfully burn the program.
At this time, you can choose the OPTION BYTE OPTION in the burn software, and then set the OPTION behind ROP to ON, and then click the burn button to burn the program, and then set the OPTION of ROP to OFF, and write the program again. At this point, you can write the program normally.
The program runs normally when it is simulated, but it cannot run normally when it is written to the microcontroller.
First check whether the procedure burning steps are normal, if the procedure burning steps are correct, but the procedure can not be normally executed, this time need to check whether the program with a reuse function of the pin, if the program used the reuse function of the pin, then through the option byte to set the reuse function. The reuse function can be set through the program as follows:
0x4803 and 0x4804 are assigned. See the data sheet for details
The value to be set is written to the OPT option byte, and the value to be set is inversely written to the complementary option byte.
The reuse function is enabled only after the current value and its inverse code are written to the option byte.
Set the pins to be reused by setting the AFR bits in OPT2.
In the actual debugging process, it is found that the multiplexing function set in the program can be executed normally in the simulation, but after the program is written to the chip, the multiplexing function cannot be executed normally. After inspection, it was found that the setting of AFR in OPTION BYTE of the burning software would be changed when the program was burned, so the reuse function of the software should be set when the program was burned.
In general, as long as the reuse function is set correctly in the burn software. The program will execute normally.
If after the above method, the burned program is not properly executed. At this time check whether the writing software STVP and simulation software STVD are opened at the same time. If after the first simulation software simulation, and then directly burning software burning procedures will appear after the program burned in, the program can not be executed normally. To close the simulation software STVD, only open the burning software STVP, at this time according to the normal steps of burning, the program can be normally executed. After the test found that after the simulation software simulation, the program will be directly downloaded to the microcontroller, without burning the chip, the program can also be executed normally.