Have you enabled the GPIO interrupt in your code? Is the IRQ pin configured for the correct interrupt type? The GPIO interrupt could be very important for the CYFISNP to complete initialization.
The PSoC Hacker
I enabled the GPIO, if you mean the "M8C_EnableGInt" function in my main.
IRQ pin is set to be:
- Select: StdCPU
- Drive : High Z
Interrupt: Rising Edge
Initial Value: 0
Do I need to write a code behind the IRQ interrupt?
M8C_EnableGInt is to enable global interrupts. To enable GPIO interrupt, you need to use:
M8C_EnableIntMask (INT_MSK0, INT_MSK0_GPIO);
This will enable the GPIO bit in the INT_MSK0 register and will enable the GPIO interrupt.
I did that and still the same, the function CYFISNP_Start(); still don't return any value.
I have 2 artaflex modules, i switched them to check that it's not a problem in the CyFi module.
I see that you have not reserved flashblock as "Unprotected" in your flashsecurity.txt file to store the CYFI network parameters. One of the activities that takes place in CYFISNP_Start( ) function is storing the network parameters in flash and for that you need to make some flash blocks as "Unprotected" so that the firmware can write data into it. It is recommended that you reserve the last few blocks in your flash area to store the network parameters.
The flashsecurity.txt file must be edited to allow Flash writes to the flash blocks. There is one ASCII character in flashsecurity.txt for each flash block of the device. The valid options for this ASCII character are 'W', 'R', 'U', and 'F'. The ASCII characters in this file define the Flash security settings that are applied to each flash block. A 'W' fully protects the Flash block from any writes and is the default setting. To allow the CYFISNP User Module to read and write blocks the protection option should be changed to 'R', 'F', or 'U'. For this project, chnage to 'U'. To properly change the security settings in flashsecurity.txt, delete the character corresponding to the Flash block to be affected. Type in a new character corresponding with the desired security setting.
Save the project and rebuild it to ensure that the changed settings have taken effect.