реклама на сайте
подробности

 
 
> Доступ к элементам структуры -> HardFault_Handler, При попытке прочитать элемент попадаю в HardFault_Handler
Arischenko Ivan
сообщение Aug 11 2012, 07:46
Сообщение #1


Частый гость
**

Группа: Участник
Сообщений: 112
Регистрация: 29-10-06
Пользователь №: 21 768



Коллеги,
Дано: IAR for ARM, 6.30.1342

Есть структура :
typedef struct
{
uint16_t Zone;
uint16_t Block;
uint16_t Page;
} NAND_ADDRESS;

создаю элемент типа этой структуры :
NAND_ADDRESS WriteReadAddr;

При попытке прочитать элемент WriteReadAddr.Zone попадаю в HardFault.
Я сделал workaround, чтобы обойти эту проблему, поменял тип элементов структуры поменял тип uint16_t на uint32_t.
typedef struct
{
uint32_t Zone;
uint32_t Block;
uint32_t Page;
} NAND_ADDRESS;

Но это не решение, просто я закопал проблему глубже.

Помоги разобраться, в чем корень проблемы?
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
Arischenko Ivan
сообщение Aug 11 2012, 10:10
Сообщение #2


Частый гость
**

Группа: Участник
Сообщений: 112
Регистрация: 29-10-06
Пользователь №: 21 768



CFSR = 0x00010000, UNDEFINSTR = 1

UNDEFINSTR: Undefined instruction Usage Fault:
0 = no undefined instruction
1 = the processor has attempted to execute an undefined instruction. When this bit is set, the PC value
stacked for the exception return points to the undefined instruction. An undefined instruction is an
instruction that the processor cannot decode. Potential reasons:
a) Use of instructions not supported in the Cortex-M device.
cool.gif Bad or corrupted memory contents.

HFSR =0x40000000, FORSED = 1

The HFSR has bit 30 set indicating that the Usage Fault
was escalated to a Hard Fault (displayed as the FORCED
bit). This is consistent with the debugger source window
that shows the PC at the Hard Fault handler address.

Прикрепленное изображение
Go to the top of the page
 
+Quote Post



Reply to this topicStart new topic
1 чел. читают эту тему (гостей: 1, скрытых пользователей: 0)
Пользователей: 0

 


RSS Текстовая версия Сейчас: 21st August 2025 - 04:40
Рейтинг@Mail.ru


Страница сгенерированна за 0.01367 секунд с 7
ELECTRONIX ©2004-2016