# Target halted due to a break instruction in user code(Cause=6 means "Instruction bus error")

**URL:** <https://forums.freertos.org/t/target-halted-due-to-a-break-instruction-in-user-code-cause-6-means-instruction-bus-error/8760>\
**Category:** Kernel\
**Created:** [February 7, 2020, 5:28am UTC](https://forums.freertos.org/t/target-halted-due-to-a-break-instruction-in-user-code-cause-6-means-instruction-bus-error/8760 "2020-02-07T05:28:23Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![saikumar.k](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@saikumar.k](https://forums.freertos.org/u/saikumar.k)\
**Post date:** [February 7, 2020, 5:28am UTC](https://forums.freertos.org/t/target-halted-due-to-a-break-instruction-in-user-code-cause-6-means-instruction-bus-error/8760/1 "2020-02-07T05:28:24Z")

</div>

Hi,  
I am trying to port FreeRtos to PIC32MZ2048EFH144 micro controller. I was created some small applications and able to use demo applications also. now i integrated the main application code which has 18 application tasks. When i am trying to run all of them, i am getting “Target halted due to a break instruction in user code” error in debugger and “General Exception Instruction bus error (cause=6, addr=a5a5a5a5).” message in console.

**The below is the execution flow of the tasks running with respective priority numbers outputted the Console:**

Resetting nRST Pin

Resetting nRST Pin completed  
TCP/IP Stack: Initialization Started

FW\_Version is 1:2  
\*\*\*\*\*\* IP Address :1\*\*\*\*\*\*

\*\*\*\*\*\*\*\*\*\*Time Sync from Ext to Internal RTC Write completed \*\*\*\*\*\*\*\*\*\*\*  
POWER ON  
Internal RTC Time & Date : 23:39:54 01/22/20

\_SYS\_Tasks Running at 18  
\_SYS\_RTCC\_Tasks Running at 17  
\_SYS\_FS\_Tasks Running at 16  
\_SYS\_TMR\_Tasks Running at 15  
\_DRV\_SDCARD\_Tasks Running at 14  
\_LED\_Control Running at 13  
\_SDCard\_Process Running at 12  
\_SDCard\_LogDeletion Running at 11  
\_SYS\_Tasks Running at 18  
\_SYS\_RTCC\_Tasks Running at 17  
\_SYS\_FS\_Tasks Running at 16  
\_SYS\_TMR\_Tasks Running at 15  
\_DRV\_SDCARD\_Tasks Running at 14  
\_LED\_Control Running at 13  
\_SDCard\_Process Running at 12  
\_SDCard\_LogDeletion Running at 11  
\_SYS\_Tasks Running at 18  
\_SYS\_RTCC\_Tasks Running at 17  
\_SYS\_FS\_Tasks Running at 16  
\_SYS\_TMR\_Tasks Running at 15  
\_DRV\_SDCARD\_Tasks Running at 14  
\_LED\_Control Running at 13  
\_SDCard\_Process Running at 12  
\_SDCard\_LogDeletion Running at 11  
\_SYS\_Tasks Running at 18  
\_SYS\_RTCC\_Tasks Running at 17  
\_SYS\_FS\_Tasks Running at 16  
\_SYS\_TMR\_Tasks Running at 15  
\_DRV\_SDCARD\_Tasks Running at 14  
\_LED\_Control Running at 13  
\_SDCard\_Process Running at 12  
\_SDCard\_LogDeletion Running at 11  
\_SYS\_Tasks Running at 18  
\_SYS\_RTCC\_Tasks Running at 17  
\_SYS\_FS\_Tasks Running at 16  
\_SYS\_TMR\_Tasks Running at 15  
\_DRV\_SDCARD\_Tasks Running at 14  
\_LED\_Control Running at 13  
\_SDCard\_Process Running at 12  
\_SDCard\_LogDeletion Running at 11MVB INIT SUCCESS

\_MVB\_Data\_Process Running at 10  
step-1

step-2

\_SYS\_Tasks Running at 18  
\_SYS\_RTCC\_Tasks Running at 17  
\_SYS\_FS\_Tasks Running at 16  
\_SYS\_TMR\_Tasks Running at 15  
\_DRV\_SDCARD\_Tasks Running at 14  
\_LED\_Control Running at 13  
\_SDCard\_Process Running at 12  
\_SDCard\_LogDeletion Running at 11VCU COMM TIMEOUT

\_MVB\_Data\_Process Running at 10  
**GPRS Modem Power ON** \*

GPRS Module Powered ON

\_Gprs\_StateMachine Running at 9  
\_GpsDataRx Running at 8  
\_RecordMVBEventRecorderData Running at 7  
\_HttpStreamDatapost Running at 6  
\_TCP\_Tasks Running at 5  
\_WDT\_Trigger Running at 4  
\_LocoConfig\_to\_EEPROM Running at 3  
\_APP\_Tasks Running at 2  
\_SYS\_Tasks Running at 18  
\_SYS\_RTCC\_Tasks Running at 17  
\_SYS\_FS\_Tasks Running at 16  
\_SYS\_TMR\_Tasks Running at 15  
\_DRV\_SDCARD\_Tasks Running at 14  
\_LED\_Control Running at 13  
\_SDCard\_Process Running at 12  
\_SDCard\_LogDeletion Running at 11  
\_MVB\_Data\_Process Running at 10AT

\_Gprs\_StateMachine Running at 9  
\_GpsDataRx Running at 8  
\_RecordMVBEventRecorderData Running at 7  
\_HttpStreamDatapost Running at 6  
\_TCP\_Tasks Running at 5  
\_WDT\_Trigger Running at 4  
\_LocoConfig\_to\_EEPROM Running at 3  
\_APP\_Tasks Running at 2  
\_SYS\_Tasks Running at 18  
\_SYS\_RTCC\_Tasks Running at 17  
\_SYS\_FS\_Tasks Running at 16  
\_SYS\_TMR\_Tasks Running at 15  
\_DRV\_SDCARD\_Tasks Running at 14  
\_LED\_Control Running at 13  
\_SDCard\_Process Running at 12  
\_SDCard\_LogDeletion Running at 11  
\_MVB\_Data\_Process Running at 10At CMD Time OUT -\> AT

\_Gprs\_StateMachine Running at 9  
\_GpsDataRx Running at 8  
\_RecordMVBEventRecorderData Running at 7  
\_HttpStreamDatapost Running at 6  
\_TCP\_Tasks Running at 5  
\_WDT\_Trigger Running at 4  
\_LocoConfig\_to\_EEPROM Running at 3  
\_APP\_Tasks Running at 2  
\_SYS\_Tasks Running at 18  
\_SYS\_RTCC\_Tasks Running at 17  
\_SYS\_FS\_Tasks Running at 16  
\_SYS\_TMR\_Tasks Running at 15  
\_DRV\_SDCARD\_Tasks Running at 14  
\_LED\_Control Running at 13  
\_SDCard\_Process Running at 12  
\_SDCard\_LogDeletion Running at 11  
\_MVB\_Data\_Process Running at 10AT

\_Gprs\_StateMachine Running at 9  
\_GpsDataRx Running at 8  
\_RecordMVBEventRecorderData Running at 7  
\_HttpStreamDatapost Running at 6  
\_TCP\_Tasks Running at 5  
\_WDT\_Trigger Running at 4  
\_LocoConfig\_to\_EEPROM Running at 3  
\_APP\_Tasks Running at 2

General Exception Instruction bus error (cause=6, addr=a5a5a5a5).

Considerations:

1. Initially i was able to run from 18 to 10, then system got into exceptional error. then i went through Execution memory and found problem in 9th priority task in which one Do{} while() loop stopping the system. So after avoiding that , now running full tasks i.e from 18 to 2(task 1 was not created) .  
In this situation i thought a watch Dog timer resets the application as scheduler hide in do{} while() loop. is it Correct??
2. after solving the first case, i was able to run all the task up to 3 iterations, but again the system got into exceptional error. this time i am not able to find the error.
3. I am using 4 uarts . 1 for GPS which continuously causing interrupt and 2 for GPRS and 3 for COM port. In addition i am using Ethernet, SD card etc mentioned above in console output.  
Please help me as early as possible .

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [February 7, 2020, 2:04pm UTC](https://forums.freertos.org/t/target-halted-due-to-a-break-instruction-in-user-code-cause-6-means-instruction-bus-error/8760/2 "2020-02-07T14:04:28Z")

</div>

> [@saikumar.k](#):
>
> i thought a watch Dog timer resets the application as scheduler hide in do{} while() loop. is it Correct??

As I’m not familiar with your application I have no way of knowing.

> [@saikumar.k](#):
>
> addr=a5a5a5a5

This is the value the stack is filled with when a task is created, so it looks like a stack or other corruption issue. Are you familiar with this page [FreeRTOS - Open Source RTOS Kernel for small embedded systems](https://www.freertos.org/FAQHelp.html) - it lists things like how to check for stack overflows, how to use configASSERT(), etc. to help you during development.

I would also recommend familiarising yourself with the “Interrupt Service Routines” section on this PIC32 specific page: [Free RTOS for PIC32MZ microcontroller with MIPS M14K core](https://www.freertos.org/PIC32MZ_RTOS_MIPS_M14K.html)

---

<div class="post-metadata">

**Author:** ![saikumar.k](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@saikumar.k](https://forums.freertos.org/u/saikumar.k)\
**Post date:** [February 10, 2020, 3:55am UTC](https://forums.freertos.org/t/target-halted-due-to-a-break-instruction-in-user-code-cause-6-means-instruction-bus-error/8760/3 "2020-02-10T03:55:31Z")

</div>

Thank you Sir,  
My problem solved. The bug is in UART ISR in which i am calling SYSCONSOLEPRINT(); So RTOS doesnot allow to switch another operation without using proper ISR API’s given by FREERTOS like **GiveFromISR();**. So when i removed it apllication working fine.

---

<div class="post-metadata">

**Author:** ![saikumar.k](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@saikumar.k](https://forums.freertos.org/u/saikumar.k)\
**Post date:** [March 5, 2020, 4:38am UTC](https://forums.freertos.org/t/target-halted-due-to-a-break-instruction-in-user-code-cause-6-means-instruction-bus-error/8760/4 "2020-03-05T04:38:04Z")

</div>

Hi,  
As i am getting this error again i need to resume the thread.  
The following is the case i analysed:

Without mutex and semaphore, the application is running continously. but when i added mutex and semaphore the application is halting approximately after 20 minutes with the error stated above.  
**Application description:**

Total tasks 17;  
number of mutex- 6  
binary semaphore - 1 for Synchronization between task and ISR

Among all these tasks , the heavy weight tasks are gps,gprs and tcpip.  
now the problem is not because of Mallochook and stackoverflow hook. It is because of **general exception handler**. When i see execution memory at the time of target halted the API flow is like this:  
**Initialise or deinitialise of ipv4,dns,dhcp**

**TCPIP\_Notification\_RemoveAll**

**Tcpip\_heap\_freeinline**

**uxlistremove**

**Vportfree**

**\_tcpipstacksignalhandlersetparams**

**SYS\_RESET\_SoftwareReset::PLIB\_DEVCON\_SystemUnlock::DEVCON\_SystemUnlock\_Default**

**SYS\_RESET\_SoftwareReset::PLIB\_RESET\_SoftwareResetEnable**

**\_genearal\_exception\_hadler** (in which target is halting and reporting me an error)

**Calloc(next API to be called listed in execution memory)**

**Note** :

1. I am printing data in uart console approx 2.5 kb /each iteration
2. I am using Heap3.c

So please give me some valuable suggestions to resolve this issue.

Regards,  
Sai kumar korada

---

<div class="post-metadata">

**Author:** ![saikumar.k](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@saikumar.k](https://forums.freertos.org/u/saikumar.k)\
**Post date:** [March 11, 2020, 12:46pm UTC](https://forums.freertos.org/t/target-halted-due-to-a-break-instruction-in-user-code-cause-6-means-instruction-bus-error/8760/5 "2020-03-11T12:46:29Z")

</div>

@rtel Hi sir,  
When can i expect the reply for the above question.

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [March 11, 2020, 2:38pm UTC](https://forums.freertos.org/t/target-halted-due-to-a-break-instruction-in-user-code-cause-6-means-instruction-bus-error/8760/6 "2020-03-11T14:38:42Z")

</div>

It is very difficult for us to debug an exception in your code remotely. Last time, if I interpret your post correctly, it was because you were printing to the console from an interrupt - are you doing that from any other interrupts, or anything else that is not really valid from an interrupt? What happens if you remove all console printing, does the code continue?

---

<div class="post-metadata">

**Author:** ![SergentSloGin](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/sergentslogin/32/48_2.png) [@SergentSloGin](https://forums.freertos.org/u/SergentSloGin)\
**Post date:** [March 12, 2020, 9:29am UTC](https://forums.freertos.org/t/target-halted-due-to-a-break-instruction-in-user-code-cause-6-means-instruction-bus-error/8760/7 "2020-03-12T09:29:24Z")

</div>

@saikumar.k Exception code 6 is mainly caused by either calling a non ISR API function from an ISR or using an application/RTOS object before it has been created.  
No one here knows your code so it’s impossible for us to tell you exactly what is wrong with it. Hopefully we’re pointing you in the right direction, as that is the only thing we can realistically do.

---

<div class="post-metadata">

**Author:** ![saikumar.k](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@saikumar.k](https://forums.freertos.org/u/saikumar.k)\
**Post date:** [March 19, 2020, 4:00am UTC](https://forums.freertos.org/t/target-halted-due-to-a-break-instruction-in-user-code-cause-6-means-instruction-bus-error/8760/8 "2020-03-19T04:00:55Z")

</div>

Hi @SergentSloGin,  
Your suggestions are really helpful. I reviewed your instructions and commented all **printf** statements. Afterwords application ran successfully upto some extent which was longer than earlier and then i got exception error.  
I reviewed my code and found i am calling API’s in ISR which are necessary here.

Also my sincere request to you to review my ISR file once.  
[System\_Interrupt.c.c](https://forums.freertos.org/uploads/short-url/1LR0qS3vbhRN1mXaXtK1VmozRvT.c) (8.9 KB)

In that file, i must have to run Ethrenet,SPI , Sys\_timer etc in ISR only. How to overcome this problem. Also i was tried to create sys\_timer as separate task by providing task synchronization using semaphore but remaining tasks running out of sync. Maximum running time is utilized by sys\_timer task only.

in addition i am posting System\_interrupt\_a.S file please refer to that also.

#include \<xc.h\>

#include “ISR\_Support.h”

/\* TMR Instance 0 Interrupt \*/  
// .extern IntHandlerDrvTmrInstance0  
//  
// .section .vector\_9,code, keep  
// .equ \_\_vector\_dispatch\_9, IntVectorDrvTmrInstance0  
// .global \_\_vector\_dispatch\_9  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorDrvTmrInstance0  
//  
//IntVectorDrvTmrInstance0:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerDrvTmrInstance0  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorDrvTmrInstance0

//#if 0  
//  
// /\* TMR Instance 1 Interrupt _/  
// .extern IntHandlerDrvTmrInstance1  
//  
// .section .vector\_19,code, keep  
// .equ \_\_vector\_dispatch\_19, IntVectorDrvTmrInstance1  
// .global \_\_vector\_dispatch\_19  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorDrvTmrInstance1  
//  
//IntVectorDrvTmrInstance1:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerDrvTmrInstance1  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorDrvTmrInstance1  
//  
//  
/_ TMR Instance 2 Interrupt \*/  
.extern IntHandlerDrvTmrInstance2

.section .vector\_14,code, keep  
.equ \_\_vector\_dispatch\_14, IntVectorDrvTmrInstance2  
.global \_\_vector\_dispatch\_14  
.set nomicromips  
.set noreorder  
.set nomips16  
.set noat  
.ent IntVectorDrvTmrInstance2

IntVectorDrvTmrInstance2:  
portSAVE\_CONTEXT  
la s6, IntHandlerDrvTmrInstance2  
jalr s6  
nop  
portRESTORE\_CONTEXT  
.end IntVectorDrvTmrInstance2

//#endif

//  
///\* USART Instance 0 Interrupt _/  
//  
// .extern IntHandlerDrvUsartReceiveInstance0  
//  
// .section .vector\_158,code, keep  
// .equ \_\_vector\_dispatch\_158, IntVectorDrvUsartReceiveInstance0  
// .global \_\_vector\_dispatch\_158  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorDrvUsartReceiveInstance0  
//  
//IntVectorDrvUsartReceiveInstance0:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerDrvUsartReceiveInstance0  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorDrvUsartReceiveInstance0  
//  
//  
// .extern IntHandlerDrvUsartTransmitInstance0  
//  
// .section .vector\_159,code, keep  
// .equ \_\_vector\_dispatch\_159, IntVectorDrvUsartTransmitInstance0  
// .global \_\_vector\_dispatch\_159  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorDrvUsartTransmitInstance0  
//  
//IntVectorDrvUsartTransmitInstance0:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerDrvUsartTransmitInstance0  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorDrvUsartTransmitInstance0  
//  
//  
// .extern IntHandlerDrvUsartErrorInstance0  
//  
// .section .vector\_157,code, keep  
// .equ \_\_vector\_dispatch\_157, IntVectorDrvUsartErrorInstance0  
// .global \_\_vector\_dispatch\_157  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorDrvUsartErrorInstance0  
//  
//IntVectorDrvUsartErrorInstance0:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerDrvUsartErrorInstance0  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorDrvUsartErrorInstance0  
//  
//  
//  
///_ USART Instance 1 Interrupt _/  
//  
// .extern IntHandlerDrvUsartReceiveInstance1  
//  
// .section .vector\_113,code, keep  
// .equ \_\_vector\_dispatch\_113, IntVectorDrvUsartReceiveInstance1  
// .global \_\_vector\_dispatch\_113  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorDrvUsartReceiveInstance1  
//  
//IntVectorDrvUsartReceiveInstance1:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerDrvUsartReceiveInstance1  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorDrvUsartReceiveInstance1  
//  
//  
// .extern IntHandlerDrvUsartTransmitInstance1  
//  
// .section .vector\_114,code, keep  
// .equ \_\_vector\_dispatch\_114, IntVectorDrvUsartTransmitInstance1  
// .global \_\_vector\_dispatch\_114  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorDrvUsartTransmitInstance1  
//  
//IntVectorDrvUsartTransmitInstance1:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerDrvUsartTransmitInstance1  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorDrvUsartTransmitInstance1  
//  
//  
// .extern IntHandlerDrvUsartErrorInstance1  
//  
// .section .vector\_112,code, keep  
// .equ \_\_vector\_dispatch\_112, IntVectorDrvUsartErrorInstance1  
// .global \_\_vector\_dispatch\_112  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorDrvUsartErrorInstance1  
//  
//IntVectorDrvUsartErrorInstance1:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerDrvUsartErrorInstance1  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorDrvUsartErrorInstance1  
//  
//  
//  
///_ USART Instance 3 Interrupt _/  
//  
// .extern IntHandlerDrvUsartReceiveInstance3  
//  
// .section .vector\_171,code, keep  
// .equ \_\_vector\_dispatch\_171, IntVectorDrvUsartReceiveInstance3  
// .global \_\_vector\_dispatch\_171  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorDrvUsartReceiveInstance3  
//  
//IntVectorDrvUsartReceiveInstance3:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerDrvUsartReceiveInstance3  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorDrvUsartReceiveInstance3  
//  
//  
// .extern IntHandlerDrvUsartTransmitInstance3  
//  
// .section .vector\_172,code, keep  
// .equ \_\_vector\_dispatch\_172, IntVectorDrvUsartTransmitInstance3  
// .global \_\_vector\_dispatch\_172  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorDrvUsartTransmitInstance3  
//  
//IntVectorDrvUsartTransmitInstance3:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerDrvUsartTransmitInstance3  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorDrvUsartTransmitInstance3  
//  
//  
// .extern IntHandlerDrvUsartErrorInstance3  
//  
// .section .vector\_170,code, keep  
// .equ \_\_vector\_dispatch\_170, IntVectorDrvUsartErrorInstance3  
// .global \_\_vector\_dispatch\_170  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorDrvUsartErrorInstance3  
//  
//IntVectorDrvUsartErrorInstance3:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerDrvUsartErrorInstance3  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorDrvUsartErrorInstance3  
//  
//  
//  
///_ USART Instance 4 Interrupt _/  
//  
// .extern IntHandlerDrvUsartReceiveInstance4  
//  
// .section .vector\_180,code, keep  
// .equ \_\_vector\_dispatch\_180, IntVectorDrvUsartReceiveInstance4  
// .global \_\_vector\_dispatch\_180  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorDrvUsartReceiveInstance4  
//  
//IntVectorDrvUsartReceiveInstance4:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerDrvUsartReceiveInstance4  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorDrvUsartReceiveInstance4  
//  
//  
// .extern IntHandlerDrvUsartTransmitInstance4  
//  
// .section .vector\_181,code, keep  
// .equ \_\_vector\_dispatch\_181, IntVectorDrvUsartTransmitInstance4  
// .global \_\_vector\_dispatch\_181  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorDrvUsartTransmitInstance4  
//  
//IntVectorDrvUsartTransmitInstance4:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerDrvUsartTransmitInstance4  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorDrvUsartTransmitInstance4  
//  
//  
// .extern IntHandlerDrvUsartErrorInstance4  
//  
// .section .vector\_179,code, keep  
// .equ \_\_vector\_dispatch\_179, IntVectorDrvUsartErrorInstance4  
// .global \_\_vector\_dispatch\_179  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorDrvUsartErrorInstance4  
//  
//IntVectorDrvUsartErrorInstance4:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerDrvUsartErrorInstance4  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorDrvUsartErrorInstance4  
//  
//  
//  
///_ SPI Instance 0 Interrupt _/  
// .extern IntHandlerSPIRxInstance0  
//  
// .section .vector\_110,code, keep  
// .equ \_\_vector\_dispatch\_110, IntVectorSPIRxInstance0  
// .global \_\_vector\_dispatch\_110  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorSPIRxInstance0  
//  
//IntVectorSPIRxInstance0:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerSPIRxInstance0  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorSPIRxInstance0  
//  
//  
// .extern IntHandlerSPITxInstance0  
//  
// .section .vector\_111,code, keep  
// .equ \_\_vector\_dispatch\_111, IntVectorSPITxInstance0  
// .global \_\_vector\_dispatch\_111  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorSPITxInstance0  
//  
//IntVectorSPITxInstance0:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerSPITxInstance0  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorSPITxInstance0  
//  
//  
// .extern IntHandlerSPIFaultInstance0  
//  
// .section .vector\_109,code, keep  
// .equ \_\_vector\_dispatch\_109, IntVectorSPIFaultInstance0  
// .global \_\_vector\_dispatch\_109  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVectorSPIFaultInstance0  
//  
//IntVectorSPIFaultInstance0:  
// portSAVE\_CONTEXT  
// la s6, IntHandlerSPIFaultInstance0  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVectorSPIFaultInstance0  
//  
//  
///_ ETHMAC Interrupt \*/  
// .extern IntHandler\_ETHMAC  
//  
// .section .vector\_153,code, keep  
// .equ \_\_vector\_dispatch\_153, IntVector\_ETHMAC  
// .global \_\_vector\_dispatch\_153  
// .set nomicromips  
// .set noreorder  
// .set nomips16  
// .set noat  
// .ent IntVector\_ETHMAC  
//  
//IntVector\_ETHMAC:  
// portSAVE\_CONTEXT  
// la s6, IntHandler\_ETHMAC  
// jalr s6  
// nop  
// portRESTORE\_CONTEXT  
// .end IntVector\_ETHMAC  
//

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
End of File  
\*/

I appreciate your help. thank you

---

<div class="post-metadata">

**Author:** ![richard-damon](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/richard-damon/32/38_2.png) [@richard-damon](https://forums.freertos.org/u/richard-damon)\
**Post date:** [March 19, 2020, 11:41am UTC](https://forums.freertos.org/t/target-halted-due-to-a-break-instruction-in-user-code-cause-6-means-instruction-bus-error/8760/9 "2020-03-19T11:41:34Z")

</div>

I haven’t reviewed your isms, but as was mentioned, ISR can’t call any of the non-ISR API, and shouldn’t do I/O that can take awhile. If in response to an ISR you want to do something like that, the ISR should signal a task to do that action. ISR need to be quick, doing minimal work to handle the interrupt, and any longer operation should be deferred to a task.

---

<div class="post-metadata">

**Author:** ![SergentSloGin](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/sergentslogin/32/48_2.png) [@SergentSloGin](https://forums.freertos.org/u/SergentSloGin)\
**Post date:** [March 19, 2020, 1:11pm UTC](https://forums.freertos.org/t/target-halted-due-to-a-break-instruction-in-user-code-cause-6-means-instruction-bus-error/8760/10 "2020-03-19T13:11:47Z")

</div>

I had a brief scan of the file and as I mentioned before and richard-damon re-iterated, ISRs need to do as little as possible. Defer to tasks any processing that isn’t time critical.

I found the following ISRs where you seem to be calling a task from within the ISR. Don’t do that. Post a message to a task and let the task monitor those messages to decide what needs to be done.

```
void __ISR(_SPI1_RX_VECTOR, ipl3AUTO) _IntHandlerSPIRxInstance0(void)
{
    DRV_SPI_Tasks(sysObj.spiObjectIdx0);
}
void __ISR(_SPI1_TX_VECTOR, ipl3AUTO) _IntHandlerSPITxInstance0(void)
{
    DRV_SPI_Tasks(sysObj.spiObjectIdx0);
}
void __ISR(_SPI1_FAULT_VECTOR, ipl3AUTO) _IntHandlerSPIFaultInstance0(void)
{
    DRV_SPI_Tasks(sysObj.spiObjectIdx0);
}
void __ISR(_ETHERNET_VECTOR, ipl5AUTO) _IntHandler_ETHMAC(void)
{
    DRV_ETHMAC_Tasks_ISR((SYS_MODULE_OBJ)0);
}

```

Hope this helps.
