Connecting to hardware issue

hello, using cw husky and sam4s target with cw313

follow lab 1- connecting to hardware, i cannot seem to read from the target. i have followed the set up steps and keep receiving this error. not sure what i am doing wrong

The most likely culprit is a mismatch between the SimpleSerial version running on the target and on the host: make sure you use the same version when you compile the firmware and when you connect to the target.

this is how i connect to the target:

and this is what shows up when compiling the fw:
image

is there something i’m missing? i thought these were the same version.

Make sure the target is clocked at 7.37 MHz. Give it a reset too.

how can i make sure the target is clocked at this rate? this is still not working.

scope.clock.clkgen_freq should be set to 7.37E6.

Hi all,
I reopen the thread because I’ve the same issue.
I checked what @jpthibault suggested:

My hardware is a CW Husky with a CW312 target.

You’ll have to provide more details. Is this related to your other post? Which firmware are you using, how did you compile it, etc…

I switched to ss2 for this example and it worked, while I’ve the bug with ss1.

I don’t know how to help you because you haven’t answered my questions: tell me what you are doing when it doesn’t work, with all the information that I need to reproduce the issue.

Sorry.
I re-opened the thread because I was executing the very same notebook “1- connecting to hardware” and executing cell by cell as described. With no modification at all (same firmware “simpleserial-base”, same notebook).

To summarize: the notebook uses ss1 and I get an error when trying to read the answer.
I recompiled with ss2 (and modified the python script) and now I get the correct reply from the cw.

At the moment this is not related with my previous post (I’ll continue on that once I am sure everything works with the provided examples, I want to be sure my firmware is not the issue, I value your time guys)

  1. What is the output of the firmware compilation?
  2. Make sure you are programming that firmware.
  3. Give the target a reset after programming.
  4. What is the output of print(target)?

Thanks a lot.
I cleaned the directory before recompiling (but seems not necessary) and run the reset_target(scope) function from the Setup_Generic.ipynb and it works with SimpleSerial protocol too (both v1 and v2) .

The make output:

SS_VER set to SS_VER_1_1
SS_VER set to SS_VER_1_1
.
Welcome to another exciting ChipWhisperer target build!!
arm-none-eabi-gcc (15:14.2.rel1-1) 14.2.1 20241119
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

mkdir -p objdir-CWHUSKY 
.
Compiling:
-en     simpleserial-base.c ...
-e Done!
.
Compiling:
-en     .././simpleserial/simpleserial.c ...
-e Done!
.
Compiling:
-en     .././hal/hal.c ...
-e Done!
.
Compiling:
-en     .././hal//sam4s/startup_sam4s.c ...
-e Done!
.
Compiling:
-en     .././hal//sam4s/sam4s_hal.c ...
-e Done!
.
Compiling:
-en     .././hal//sam4s/uart.c ...
-e Done!
.
Compiling:
-en     .././hal//sam4s/pio.c ...
-e Done!
.
Compiling:
-en     .././hal//sam4s/system_sam4s.c ...
-e Done!
.
Compiling:
-en     .././hal//sam4s/sysclk.c ...
-e Done!
.
Compiling:
-en     .././hal//sam4s/pmc.c ...
-e Done!
.
LINKING:
-en     simpleserial-base-CWHUSKY.elf ...
Memory region         Used Size  Region Size  %age Used
             rom:        2912 B       128 KB      2.22%
             ram:        4648 B        64 KB      7.09%
-e Done!
.
Creating load file for Flash: simpleserial-base-CWHUSKY.hex
arm-none-eabi-objcopy -O ihex -R .eeprom -R .fuse -R .lock -R .signature simpleserial-base-CWHUSKY.elf simpleserial-base-CWHUSKY.hex
.
Creating load file for Flash: simpleserial-base-CWHUSKY.bin
arm-none-eabi-objcopy -O binary -R .eeprom -R .fuse -R .lock -R .signature simpleserial-base-CWHUSKY.elf simpleserial-base-CWHUSKY.bin
.
Creating load file for EEPROM: simpleserial-base-CWHUSKY.eep
arm-none-eabi-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
--change-section-lma .eeprom=0 --no-change-warnings -O ihex simpleserial-base-CWHUSKY.elf simpleserial-base-CWHUSKY.eep || exit 0
.
Creating Extended Listing: simpleserial-base-CWHUSKY.lss
arm-none-eabi-objdump -h -S -z simpleserial-base-CWHUSKY.elf > simpleserial-base-CWHUSKY.lss
.
Creating Symbol Table: simpleserial-base-CWHUSKY.sym
arm-none-eabi-nm -n simpleserial-base-CWHUSKY.elf > simpleserial-base-CWHUSKY.sym
Size after:
   text	   data	    bss	    dec	    hex	filename
   2912	      4	   4644	   7560	   1d88	simpleserial-base-CWHUSKY.elf
+--------------------------------------------------------
+ Default target does full rebuild each time.
+ Specify buildtarget == allquick == to avoid full rebuild
+--------------------------------------------------------
+--------------------------------------------------------
+ Built for platform CW-Husky Microchip SAM4S with:
+ CRYPTO_TARGET = NONE
+ CRYPTO_OPTIONS = AES128C
+--------------------------------------------------------

I checked that firmware is the one is programmed.

Reset done.

<class 'chipwhisperer.capture.targets.SimpleSerial.SimpleSerial'>
SimpleSerial Settings =
	output_len             = 16
	baud                   = 38400
	simpleserial_last_read = 
	simpleserial_last_sent = 
	xonxoff                = None
	currently_xoff         = None
	parity                 = none
	stop_bits              = 1