| 数据搜索系统,热门电子元器件搜索 |
|
SW4STM32C 数据表(PDF) 51 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
SW4STM32C 数据表(HTML) 51 Page - STMicroelectronics |
|
51 / 99 page ![]() DocID030181 Rev 2 51/99 AN4989 Exception handling 98 Figure 32. Keil® Access to Show Caller Code in Contextual menu 6.3 Trapping div/0 exception Most often, code execution causing a division by zero are difficult to investigate: • Nothing is neither triggered nor trapped. • Erroneous returned value generates an unexpected and unpredictable behavior that is very difficult to analyze. This chapter gives several tips in order to properly trap div/0 exceptions. 6.3.1 Cortex®-M0/M0+ case For targets that do not support hardware division instructions (SDIV/UDIV), integer division- by-zero errors can be trapped and identified by means of the appropriate C library helper functions: __aeabi_idiv0() When integer division by zero is detected, a branch to __aeabi_idiv0() is made. A breakpoint placed on __aeabi_idiv0() allow to trap the division by zero. To ease the breakpoint application, override the default function: void __aeabi_idiv0() { #ifdef DEBUG __BKPT(0); #endif } This way, and depending on IDE, the call stack or registers can be examined and the offending line in the source code can be rapidly found. To go further refer to section 7.7 of ARM® Compiler Software Development Guide. |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |