- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I write the programmer code for posc6 on stm32 chip according to the following instructions.
But there is a fail in the Step 1.A – Acquire PSoC 6 MCU, pcVal is out of range ,it is always fail.
if (((pcVal >= MEM_BASE_ROM) && (pcVal < (MEM_BASE_ROM + MEM_SIZE_ROM))) || ((pcVal >= MEM_BASE_SFLASH) && (pcVal < (MEM_BASE_SFLASH + MEM_SIZE_SFLASH))))
{
bSwdAcquired=TRUE;
}
else
{
bSwdAcquired=FALSE;
}
Can someone help me?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#define MEM_BASE_ROM 0x00000000 // Base address of System ROM
#define MEM_SIZE_ROM 0x00020000 // Size of System ROM
#define MEM_BASE_SFLASH 0x16000000 // Base address of Supervisory Flash region
#define MEM_SIZE_SFLASH 0x00008000 // Size of Supervisory Flash region
If (((pcVal >= MEM_BASE_ROM) && (pcVal < (MEM_BASE_ROM + MEM_SIZE_ROM)))
|| ((pcVal >= MEM_BASE_SFLASH) && (pcVal < (MEM_BASE_SFLASH + MEM_SIZE_SFLASH))))
pcVal =0x0800172A is not a valid value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Each subroutine provided in the spec supports return value, you can use this feature to check out from which line CPU start to get error return value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I checked again, it is all right before the "ReadIO (0xE000EDF8, OUT pcVal); after this operation, the out put value pcVal is out of range
// Check PC – in Test Mode, it must point to address in ROM or in SFLASH
WriteIO (0xE000EDF4, 0x0000000F);
ReadIO (0xE000EDF8, OUT pcVal);
if (((pcVal >= MEM_BASE_ROM) && (pcVal < (MEM_BASE_ROM + MEM_SIZE_ROM))) || ((pcVal >= MEM_BASE_SFLASH) && (pcVal < (MEM_BASE_SFLASH + MEM_SIZE_SFLASH))))
return PASS
else return FAIL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
#define MEM_BASE_ROM 0x00000000 // Base address of System ROM
#define MEM_SIZE_ROM 0x00020000 // Size of System ROM
#define MEM_BASE_SFLASH 0x16000000 // Base address of Supervisory Flash region
#define MEM_SIZE_SFLASH 0x00008000 // Size of Supervisory Flash region
If (((pcVal >= MEM_BASE_ROM) && (pcVal < (MEM_BASE_ROM + MEM_SIZE_ROM)))
|| ((pcVal >= MEM_BASE_SFLASH) && (pcVal < (MEM_BASE_SFLASH + MEM_SIZE_SFLASH))))
pcVal =0x0800172A is not a valid value.