Дошли руки до 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];
}
Че я нетак делаю?