Acquire PSoC6 MCU failed

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
yiru_1705901
Level 4
Level 4
First solution authored 25 replies posted 25 sign-ins
hello all ,

I write the programmer code for  posc6 on stm32 chip according to the following instructions.

https://www.cypress.com/documentation/programming-specifications/psoc-6-programming-specifications?s...

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?

  

0 Likes
1 Solution

#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.

View solution in original post

4 Replies
Vison_Zhang
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 250 sign-ins

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.

0 Likes
yiru_1705901
Level 4
Level 4
First solution authored 25 replies posted 25 sign-ins

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

0 Likes
yiru_1705901
Level 4
Level 4
First solution authored 25 replies posted 25 sign-ins

the out put value pcVal =0x0800172A,it is effective value , I can't understand why is it out of range

  

Effective value

0 Likes

#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.