problem with the flash memory of the TLE9879 - It does not load the new program

Announcements

Webinar: Integrated solutions for smaller, simpler low-voltage motor control design.
Join the webinar to experience!

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
wph1995
Level 4
Level 4
100 sign-ins First like received 25 replies posted

I have two really stressful problems:


1.- I try to use the timers with interruptions, I change the state of a led at a frequency of 1Hz, but it does not do so, the led simply stays on and turns off 100ms every second, and the TLE9879 restarts every 2 seconds even that is not in the code, try commenting the watchdog function, but the error persists, do you think the error is in the configuration of the internal oscillator? Do I configure it manually, I will place a photo of my code and the configuration.

 

1.jpg

 

2.jpg

 

 

 

3.jpg

 

5.jpg

 

6.jpg

 

2.- I try to load a new program, but apparently it doesn't because when I reset the chip it still has the old program, apparently it loads successfully but it still has the old program.

thanks for your help

0 Likes
1 Solution
wph1995
Level 4
Level 4
100 sign-ins First like received 25 replies posted

After many attempts, I got it, I'm not sure, but HALL, FOC and all the other codes are stored in specific memory addresses, but the TLE9879 reads from the first memory address when it executes the falsh code, when I create a new project KEIL loads the program from the first address of the flash, so, apparently when I loaded my code on the chip, it only erased the memory space that the new code needed, and the other registers continued to have the old code, and that's why it didn't work, I had to delete all the previous code and be able to load the new one. that is something strange, but we could tell because we read all the flash addresses from J Flash, I can now load new programs that way, and also solved the reboot problem, wdt1 reboots the chip after about 1008ms , I used the Delay_us() function, if I introduce values ​​very close to 1s as a parameter of the Delay_ms() function, the WDT1 will restart the chip, but if I use small time values ​​it will not restart it... I thought it would be simpler to use the TLE9879 chip 😅,.

Is there a programming manual for the TLE 9879 but in C/C++ language? or any user guide to configure the peripherals of the TLE9879 using the Config Wizard v2.X?.

Thanks for the help

View solution in original post

0 Likes
10 Replies
wph1995
Level 4
Level 4
100 sign-ins First like received 25 replies posted

I just made an attempt, and the program works in debug mode, but when I restart it it stops working 😓

0 Likes
RupakC
Moderator
Moderator
Moderator
100 solutions authored 250 sign-ins 25 likes received

Hello @wph1995 

May I know which code you are using ? Is it a custom code that you have written ?

Could you please try to load the available codes that are there ?? 

Are you using the EVALKIT or the BLDC shield of TLE9879? 

Since you say that after apparent loading, it still has the same problem, changing the clock configuration to manual will probably not help. If you reply to my queries above and try to load the device with example codes like FOC  or BEMF, I will be able to provide some more help on this issue.

Thank you 

RupakC
0 Likes
wph1995
Level 4
Level 4
100 sign-ins First like received 25 replies posted

Excuse me, I'll say it better. I created a custom code to blink a Led, using timer 2 but the chip did everything wrong, I thought timer 2 or the internal oscillator was wrong, so I configured them manually and it didn't work, I put the chip in debug mode and yes it worked So my first problem is that the chip doesn't execute programs in run mode, but it does in degub mode. my second problem is that I try to load the HALL, FOC and BEMF test code for the TLE9879 shield but it still has the previous code, KEIL tells me that I load the program correctly but it is not, because when I turn off and then turn on the chip, continue with the previous program, when I create a new project and create a new code, I can load the program correctly in the chip but when I try to load the example code of the TLE9879 shield, it does not load the new program but continues to have the previous program .

I copied the electrical schematic of the shield of TLE9879 and add it to my own PCB

0 Likes
RupakC
Moderator
Moderator
Moderator
100 solutions authored 250 sign-ins 25 likes received

Hello @wph1995

 Could you please share the schematic of your custom pcb ? 

Also, did you try programming the device with another programmer/J-link ? This is just for a check.

Thanks and Regards 

RupakC
0 Likes
RupakC
Moderator
Moderator
Moderator
100 solutions authored 250 sign-ins 25 likes received

Hello @wph1995 

One more thing. Can you confirm if you are programming the RAM or the Flash of the device ? This is important. 

Regards

RupakC
0 Likes
wph1995
Level 4
Level 4
100 sign-ins First like received 25 replies posted

I don't have access to the schematic now, but when I checked it it was the same electrical diagram as the TLE9879 shield, basically it's just a copy and paste, we only have a J-Link BASE and I did the tests with the one I have. The first four images that I send are the configuration of the example programs that you have on your page

ejemplo_inf_1.jpg

 

ejemplo_inf_2.jpg

 

ejemplo_inf_3.jpg

 

ejemplo_inf_4.jpg

 

And these last four images are from the KEIL configuration, when I create a new project:

mio_1.jpg

 

mio_2.jpg

 

mio_3.jpg

 

mio_4.jpg

My problem only appears when I want to load the example programs of the TLE9879 shield, if I try to load an example program, FOC or HALL or BEMF or Bootloader, it apparently loads them correctly, but it does not because it still has the previous program on the chip

Also, I still have the problem that the code that I upload to the chip is executed ONLY when it is in debug mode, but I have some doubts with the watchdog, how can I completely disable the watchdog? Is it possible to do that?

 

Thanks for the help

0 Likes
wph1995
Level 4
Level 4
100 sign-ins First like received 25 replies posted

I was able to execute the program in run mode, just disable NAC/NAD using the Config Wizard and it worked, (hope I didn't have any problems disabling that...) also use J - Link Commander and J - Flash to read the chip flash registers, it is very strange, because apparently it loads the program in the flash, in the memory registers that I configure, however the program is not executed, and the NAC/NAD is also disabled. How could I solve that?

0 Likes
RupakC
Moderator
Moderator
Moderator
100 solutions authored 250 sign-ins 25 likes received

Hello @wph1995 

I need some more information. Considering only the BEMF or the HALL or the FOC code, how do you conclude that the code is not being executed and the previous program runs ? Can you comment out the part of the FOC code in the shield where it is taking the start command from the arduino? In this case, the motor should not run. In the next instance, uncomment that same part of the code such that now the motor runs when the arduino provides the start motor command. Please check if the motor behaves appropriately in the two cases or not. 

Regarding the LED not glowing, it would be great if I could have your schematic. That would help me to quickly check for errors in your pcb if any.  Since you do not have access it can take some time to find out why your custom board is not working. 

The NAC/NAD part is for the bootstrap. The FOC code by default has this NAC/NAD disabled. So disabling it should not be an issue. 

Regards

RupakC
0 Likes
wph1995
Level 4
Level 4
100 sign-ins First like received 25 replies posted

After many attempts, I got it, I'm not sure, but HALL, FOC and all the other codes are stored in specific memory addresses, but the TLE9879 reads from the first memory address when it executes the falsh code, when I create a new project KEIL loads the program from the first address of the flash, so, apparently when I loaded my code on the chip, it only erased the memory space that the new code needed, and the other registers continued to have the old code, and that's why it didn't work, I had to delete all the previous code and be able to load the new one. that is something strange, but we could tell because we read all the flash addresses from J Flash, I can now load new programs that way, and also solved the reboot problem, wdt1 reboots the chip after about 1008ms , I used the Delay_us() function, if I introduce values ​​very close to 1s as a parameter of the Delay_ms() function, the WDT1 will restart the chip, but if I use small time values ​​it will not restart it... I thought it would be simpler to use the TLE9879 chip 😅,.

Is there a programming manual for the TLE 9879 but in C/C++ language? or any user guide to configure the peripherals of the TLE9879 using the Config Wizard v2.X?.

Thanks for the help

0 Likes
RupakC
Moderator
Moderator
Moderator
100 solutions authored 250 sign-ins 25 likes received

Hi @wph1995 

It is wonderful that your code is now running successfully. Could you please create another thread for this new question ? This will help other users to find a similar solution by searching for the correct keywords. 

Regards

RupakC
0 Likes