Avr32 Bus Error Data Fetch
Contents |
CommunitiesAVR FreaksAtmel SMART ARM-based MCUsInternet of ThingsCapacitive TouchProjectsVendorsWiki You are hereHome » Communities » AVR Freaks » Forums » AVR Microcontrollers » AVR UC3 » Bus Error Data Fetch and serial Main menu mobile Home Communities avr bus error data fetch Forums Projects Vendors Wiki Search My summary Privacy Contact Site Use Terms Cookies Communities
Bus Error Instruction Fetch Avr32
Forums Projects Vendors WIKI Bus Error Data Fetch and serial Log in or register to post comments Go To Last Post 8 posts / 0 new Author Message IvanSB Level: Wannabe Joined: Sat. Jul 3, 2010 Posts: 59 View posts Location: Milan, Italy #1 Posted by IvanSB: Sat. Jan 15, 2011 - 12:06 AM Fivestar widget 12345Total votes: 0 I've been copy&pasting evk1100 example programs to be able to write on flash and use serials under FreeRTOS I've started from a simple example (adc) and then added modules from the framework and copyed what was in the original "panel" example. Once I added a couple of functions taken from the Drivers USART example when the program run, after a while I get a Bus Error Data Fetch exception. I can actually write to the serial port. I still can't reliably read. What I did was initializing the serial port xDisplayPortHndl = xUsartInit( serCOM1, DISPLAY_BAUDRATE, DISPLAY_RXBUFFER_LEN, DISPLAY_TXBUFFER_LEN ); and then call inside a FreeRTOS: void vdisplay_PrintArray(const signed portCHAR *pcString, unsigned portSHORT usMsgLen) { unsigned portSHORT usRemainChar = 0; if(usMsgLen==0) return; usRemainChar = usMsgLen; do { usRemainChar = usUsartPutString( xDisplayPortHndl, (const signed portCHAR *)(pcString + usMsgLen - usRemainChar), usRemainChar ); }while( usRemainChar ); } this way void display_test(void) { static signed portCHAR test_pattern[] = { 0x11, 0x0A, 0x1B, 0x44, 0x4C, 0x1B, 0x47, 0x44, 0x00, 0x00, 0xEF, 0x7F, 0xDA }; static unsigned short s = 0; signed portCHAR *pcByte; signed portCHAR b; switch (s) { case 0: LED_On( LED0 ); vdisplay_PrintArray(test_pattern, 13); s=1; break; case 1: //display_GetChar(pcByte); LED_On( LED1 ); b = *pcByte; b++; if(b==0x06) { LED_On( LED2 ); } s=0; break; } } If I initialize the USART but skip to call display_test() everything works fine... if I just repeatedly (at 500ms intervals) display_test() I get the Bus exception. What actually is a Bus exception of this kind and what could be the root of the problem? thanks Tags:AVR Microcontrollers, AVR UC3 Log in / register to post comments Top danicampora Level: Hangaround Joined: Tue. Oct 9, 2007
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up AVR32 exception: Bus Data Error up vote 4 down vote favorite Recently, I am facing a - to http://www.avrfreaks.net/forum/bus-error-data-fetch-and-serial me - strange behavior in my embedded software. What I got: Running a 32 bit AVR32 controller, starting the program from an external SDRAM, as the file size is too big to start it directly from the micro-controller flash. Due to the physical memory map, the memory areas are split between: stack (start at 0x1000, length of 0xF000) ( < 0x1000 is protected by the MPU) EBI SDRAM (start at 0xD0000000, length http://stackoverflow.com/questions/32712816/avr32-exception-bus-data-error of 0x00400000). What happens: Unfortunately I got an exception, which is not reproducible. Looking at my given stack trace, the following event irregular occurs: Name: Bus error data fetch - Event source: Data bus - Stored Return Address: First non-completed instruction Additionally, the stack pointer has a valid value, whereas the address where the exception occurs (last entry point for fetching instructions), points into the memory nirvana (e.g. 0x496e6372, something around 0x5..., 0x6....). I guess, this has to be the "First non-completed instruction", the manual is talking about. However, the line in my source code is always the same: accessing a member function from a data array via pointer. if(mSomeArray[i]) { mSomeArray[i]->someFunction(); <-- Crash } The thing is: adding or deleting other source code makes the event disappear and return again. What I thought about: Something is corrupting my memory (mapping). What kinds of errors are possible for this? A buffer overflow? The SDRAM controller could be turned off, so it loses some data. That is not impossible, but rather improbably The stack is big enough, I already checked this with a watermark The Data Bus Rate and AVR clock are set correctly How to solve this: More assert? Unfortunately I cannot debug this with AVRStudio. Anyone a hint or idea? Or am I mi
enabled. Below is a static menu. Home FreeRTOS Books and Manuals FreeRTOS About FreeRTOS What is an RTOS/FreeRTOS? http://www.freertos.org/FreeRTOS_Support_Forum_Archive/April_2009/freertos_AVR32_UC3A0512_Free_RTOS_3210037.html A Compelling Free Solution A Better Type of Open Source Features http://www.simplemachines.it/martin/mizar32/1.6.0-AT32UC3/SERVICES/FREERTOS/Demo/AVR32_UC3/DOC/html/exception_8S-source.html Overview Coding Standard & Style Licensing Site Map Features / Getting Started... Quick Start Guide Tasks & Co-routines More About Tasks... Task States Task Priorities Implementing a Task Idle Task and Idle Hook More About Co-routines... Co-routine Status Co-routine Priorities Implementing a Co-routine Scheduling Co-routines Limitations bus error and Restrictions Quick Co-routine Example Standard Demo Examples Queues, Mutexes, Semaphores... Queues Binary Semaphores Counting Semaphores Mutexes Recursive Mutexes Direct To Task Notifications Introduction ...As Binary Semaphore ...As Counting Semaphore ...As Event Group ...As Mailbox Software Timers Introduction Timer Service Daemon Task Timer Daemon Configuration One-Shot Vs Auto-Reload Resetting a Timer Event Groups (or 'flags') Source Code Organisation bus error data More Advanced... Creating a New Project FreeRTOSConfig.h Trace Features Low Power Support Run Time Stats Blocking on Multiple Objects Deferred Interrupt Handling Static Vs Dynamic Memory Memory Management Memory Protection Support Stack Overflow Protection Hook Functions Thread Local Storage Pointers How FreeRTOS Works Introduction Fundamentals Multitasking Basics Schedulinig Basics Context Switching Real Time Applications Real Time Scheduling Implementation Building Blocks Development Tools The RTOS Tick GCC Signal Attribute GCC Naked Attribute FreeRTOS Tick Code AVR Context Saving the Context Restoring the Context Detailed Example Putting It All Together Step 1 Step 2 Step 3 Step 4 Step 5 Step 6 Step 7 RAM Constrained Design Tips Page 1 Page 2 Page 3 Page 4 Page 5 Porting Guide Windows Simulator Posix/Linux Simulator Legacy Trace Facility Demo Projects Standard Demos Basic Demos Hardware Independent Modifying a Demo TCP/IP Demos Supported Devices & Demos Official & Contributed Definitions Simple List of Ports Officially Supported Demos TCP/IP Demos API Reference PDF Reference Manual Task Creation TaskHandle_t (type) xTaskCreate() vTaskDelete() Task Control vTaskDelay() vTaskDelayUntil() uxTaskPriorityGet() vTaskPrioritySet
00022 * 00023 * Redistribution and use in source and binary forms, with or without 00024 * modification, are permitted provided that the following conditions are met: 00025 * 00026 * 1. Redistributions of source code must retain the above copyright notice, this 00027 * list of conditions and the following disclaimer. 00028 * 00029 * 2. Redistributions in binary form must reproduce the above copyright notice, 00030 * this list of conditions and the following disclaimer in the documentation 00031 * and/or other materials provided with the distribution. 00032 * 00033 * 3. The name of Atmel may not be used to endorse or promote products derived 00034 * from this software without specific prior written permission. 00035 * 00036 * 4. This software may only be redistributed and used in connection with an Atmel 00037 * AVR product. 00038 * 00039 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 00040 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00041 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 00042 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 00043 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00044 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00045 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00046 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00047 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00048 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 00049 * 00050 */ 00051 00052 #include