Dry goods sharing: Why is the DSP program running? How did you solve it?

What are the reasons for the DSP program running away? How did you solve it? Brainstorming in the name of academics is taking place in the e-family forum. Let's take a look at the dry goods you deserve.

Michael_xing:

Let me talk about my previous project experience.

There are two options for the general debugging code steps.

Solution 1: First debug the main program, and finally add a protection circuit such as a watchdog;

Solution 2: First build a code environment, such as a watchdog protection circuit, and then develop the main program on the platform.

For me, in order to better write algorithm code, I plan to use it.

In the process of debugging my code, I encountered the following program running:

[Cause] Hardware watchdog circuit design error

[Design] In the design of my design, I designed the hardware watchdog circuit with Maxim chip MAX706AT. It seems to be a perfect circuit. When connecting the simulator for simple square wave output test, I found that the DSP has no task output. The program is already abnormal, because I used the program one to design the code, so I only know the exception and don't know the reason.

【Solutions】

1, countless download programs, and run the program, but the program is always running abnormally.

2. Fortunately, there are several IOs that directly drive the LEDs in my circuit design. At this time, I noticed that the brightness of the LED display is not normal. Then, I quickly test the IO voltage with a multimeter. The result is only about 1.6V. . At this time, I have already understood that the watchdog is abnormal.

3, troubleshooting the MAX706AT circuit in the circuit, there is no problem at all. When the MAX706AT's package and pinouts were found, the root cause of the problem was discovered. The chip is available in both SO and UMAX packages. It is strange to say that the names are identical, the package is different, and the pin definitions are different, causing the reset voltage of the watchdog chip to always be low.

Finally found the problem.

Michael_xing:

In the process of debugging my code, I encountered the following program running:

[Cause] The interrupt processing timeout caused the program to run away.

[Design] I designed the bipolar signal acquisition system based on TMS320F28335(4). Because of the high frequency, the interrupt acquisition method is adopted. That is to say, I use the PWM output square wave to trigger the acquisition module to start collecting. After latching, it will be interrupted

Tell dsp to read the data. Then the data read is done in the interrupt.

In the first version, the sampling trigger is performed with a period of = 20ms/256.

Very strange problem has occurred. In DEBUG mode, there is no problem, data can be collected, but in RELEASE mode, when the data is collected, the program runs away.

When you realize that the program is running away, you suspect that the interrupt routine is too long or the processing time is too long.

【Solutions】

If the guessing period is too short, then the period can be increased, the period = 20ms/128, and the failure still ends.

Reduce cycle = 20ms/64, okay.

It is advisable to chase after the poor, the cycle is reduced to = 20ms/32, okay

The first time it was solved.

[attached] When using dsp for algorithm processing, you must first evaluate the algorithm. Otherwise, when you realize your own program problem, it is too late, because after the parameter is modified, it may not meet the system requirements.

Cresta:

The reasons why I have encountered DSP programs running are:

1. Careless operation of the subfunction return address value.

2. The value overflows, reads and writes over the range of storage space, stack overflow, and so on.

The program is a program with a BIOS. When the program runs away, I set a breakpoint on the last line of the main function. As a result, the program can run to the last line of the main function. The next step is to initialize the BIOS operating system. The source code of the operating system. It was invisible, so it was in a stalemate. I don't know what to do.

I was running when I was porting the program. Later I compared the BIOS configuration of my program with another normal BIOS configuration. I found that the Stack Size is 0x400 (the default configuration) and the other is 0x1000, then After I changed it, the program returned to normal.

In the beginning, I realized that the program caused by the stack overflow might run away, so I increased the dynamic stack on each memory, namely: create a heap in this memory heap size: 0x08000. The result does not work.

The Stack Size (MAUs) option, which was later modified, changed the global stack size from 0x400 to 0x1000. Then the problem was ruled out. Later I realized that the dynamic stack is used to dynamically create tasks, not the one I want. After reflection, it is still a big mistake caused by the unfamiliarity of the BIOS system!

Ice Age:

I have encountered the program of the single-chip computer running, there is static interference. Overclocking is too large. Causes instability.

Significant product benefits1)A full line of spools in a variety of standard sizes
2)High speed custom labeling and printing on flanges available – even on short runs
3)One piece molded construction for strength and precision
4)Appealing designs as well as ergonomics (no sharp edges)
Type Weight
(g)
d1
(mm)
D1
(mm)
d2
(mm)
D2
(mm)
H1
(mm)
H2
(mm)
d3
(mm)
A1
(mm)
A2
(mm)
d4
(mm)
E
(mm)
DIN-125 170 125 80 100 125 20 12.5 12.5 7 20
DIN-160 350 160 100 128 160 22 16 16 13 32
DIN-200A 600 200 125 160 200 22 20 20 13.5 32
DIN-200B 600 200 125 160 200 32 20 20 13.5 32
DIN-200C 650 200 125 160 200 32 20 20

DIN-250A 1050/1200 250 160 160 200 22 20 20 13 32
DIN-250B 1050 250 160 160 200 32 20 20 13 32
S-250 1230 250 160 157 197 127 20 20

NP-13A 885 202 119 154 188 32 17 17 9/14 49/26.75
NP-13B 885 202 119 154 188 33 17 17 9.5/12.5 50.25/26.25
NS-4 225 120 75 130 150 16/20 10 10 10 22
NS-5A 220 120 54 130 150 16/20 10 10

NS-5B 220 120 54 130 150 22 10 10

LH-120 170 120 50 100 120 16/20 10 10 6 17

 

ABS Wire Spool

ABS Wire Spool, Plastic Spools, Plastic Spools For Wire, Plastic Spool Bobbin

NINGBO BEILUN TIAOYUE MACHINE CO., LTD. , https://www.spool-manufacturer.com