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

 
 
> IAP неполучаеццо :(, влетает в эксепршены
klen
сообщение Aug 20 2007, 15:27
Сообщение #1


бессмертным стать можно тремя способами
*****

Группа: Свой
Сообщений: 1 405
Регистрация: 9-05-06
Из: Москва
Пользователь №: 16 912



Дошли руки до IAP, прочитал мануал, написал код - сначала не работало, потом заработало, чето потрогал руками опять перестало работать. Пока тренируюсь на вызове запроса partID. стопрацентный заход в PAbort или DAbort, в эксепшене lr коворит адрес 0x7ffffff8, прерывания отключены, вызов иапа сразу в начале main.


код вызова:
Код
#include "iap.h"

#define IAP_LOCATION 0x7ffffff1

unsigned int command[5];
unsigned int result[2];

#define PrepareSectors4Write 50
#define RAM2Flash            51
#define EraseSectors         52
#define BlankCheckSectors    53
#define ReadPartID           54
#define ReadBootCodeVersion  55
#define Compare              56
#define ReinvokeISP          57


#define CMD_SUCCESS         0      //  Command is executed successfully.
#define INVALID_COMMAND     1      //  Invalid command.
#define SRC_ADDR_ERROR      2      //  Source address is not on a word boundary.
#define DST_ADDR_ERROR      3      //  Destination address is not on a correct boundary.
#define SRC_ADDR_NOT_MAPPED 4      //  Source address is not mapped in the memory map.
#define DST_ADDR_NOT_MAPPED 5      //  Destination address is not mapped in the memory
#define COUNT_ERROR         6      //  Byte count is not multiple of 4 or is not a permitted value.
#define INVALID_SECTOR      7      //  Sector number is invalid.
#define SECTOR_NOT_BLANK    8      //  Sector is not blank.
#define SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION 9 //Command to prepare sector for write operation was not executed.
#define COMPARE_ERROR       10     //  Source and destination data is not same.
#define BUSY                11  


typedef void (*IAP)(unsigned int*,unsigned int* );
IAP iap_entry =(IAP) IAP_LOCATION;

void GetPartID ( unsigned int* pid  )
{
   command[0] = ReadPartID;
   result[0]=-1;
   result[1]=-1;
   iap_entry (command, result);
  
   *pid = result[1];
}


Че я нетак делаю?
Go to the top of the page
 
+Quote Post
 
Start new topic
Ответов
GetSmart
сообщение Aug 20 2007, 17:42
Сообщение #2


.
******

Группа: Участник
Сообщений: 4 005
Регистрация: 3-05-06
Из: Россия
Пользователь №: 16 753



Ну я серьёзно! Пишите уж так:
Код
((void( __interwork *)( void *, void *))IAP_LOCATION)( iaps, &iaps->status );

Тоже поймёт любой компилятор и с любыми настройками проекта

Сообщение отредактировал GetSmart - Aug 20 2007, 17:46


--------------------
Заблуждаться - Ваше законное право :-)
Go to the top of the page
 
+Quote Post

Сообщений в этой теме


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

 


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


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