2019-04-04 02:15 AM
Hi everyone,
I use a custom stm32f0 board and i try to catch data coming from can bus and answer it back to can bus line. In the begining my program works good but after a couple of minutes mcu stucks in reset(i am not sure of the cause is from software or hardware but 'nrst' pin pulling down to 800mV-1.2V). i need power off and wait 15-30 min, for a reprograming. swd connection errors; 'couldn't be able to stop cortex-m device! Please check the jtag cable'
in my design i made some mistakes such as; nrst pin isn't connected to pull up resistor and pull down capacitor.
if i change the nrst pin pull up with 10k(or less) and pull down with 100nF will my problem solve?
there is my custom design and code.
Solved! Go to Solution.
2019-04-10 01:19 AM
I giving up about can bus. i cant figure it out. i will change the system to rs485 hope mcu don't reset himself again. Hardware or software whatever, that's annoying. Thanks for help.
2019-04-04 07:06 AM
any suggestion ???
2019-04-04 11:54 PM
question is in the wrong place or question is so hard ?
2019-04-05 07:39 AM
NRST pin has an weak pullup resistor internally. It is a bidirectional pin.
The external capacitor is recommended to protect the device from parasitic resets.
THe NRST pin is pulled low by the system reset internally.
A system reset is generated when one of the following events occurs:
1. A low level on the NRST pin (external reset)
2. Window watchdog event (WWDG reset)
3. Independent watchdog event (IWDG reset)
4. A software reset (SW reset) (see Software reset)
5. Low-power management reset (see Low-power management reset)
6. Option byte loader reset (see Option byte loader reset)
7. A power reset
Please check you code to see if your program is entering any of these situations.
Do you have implemented Exception Handlers (Hard fault, in particular)?
2019-04-05 08:07 AM
How can i check entering these situations ? i didnt implement exception handlers. I use cubemx for generating library, it cubemx implements hard fault handler? When i working in debug mod, resets kick me out. i didnt handle it.
2019-04-05 08:46 AM
i written a simple code, it transmit data to CANBUS in repeat at 500ms. I set a card, it have dip switch( just 1 switch is on),can transreceiver,power lane, mcu. I set one more card to, it have can transreceiver,power lane and mcu. i remove dip switch identification from board.(other components not placed to boards) After 30 min i check the CANBUS. first card which is have a dip switch is gone to reset. the other card working well... this dip switch connections makes mcu to reset? what is problem? to much ampere on pins?
hcan.pTxMsg->Data[0] = 'I';
hcan.pTxMsg->Data[1] = 'Y';
hcan.pTxMsg->Data[2] = 'I';
hcan.pTxMsg->DLC = 3;
HAL_CAN_Transmit(&hcan,30);
HAL_Delay(500);
2019-04-10 01:19 AM
I giving up about can bus. i cant figure it out. i will change the system to rs485 hope mcu don't reset himself again. Hardware or software whatever, that's annoying. Thanks for help.