stlink-common: Update STM32L0 and STM32L1 loader ABI
[fw/stlink] / src / test_usb.c
index 896d8b89bf0708d55d530886db4b7353c555df45..787ac12ce05e0544cbecc0867f25138ebe47f04f 100644 (file)
@@ -6,11 +6,15 @@ int main(int ac, char** av) {
     stlink_t* sl;
     reg regs;
 
-    sl = stlink_open_usb(NULL, 10);
+    /* unused */
+    ac = ac;
+    av = av;
+
+    sl = stlink_open_usb(10, 1, NULL);
     if (sl != NULL) {
         printf("-- version\n");
         stlink_version(sl);
-        
+
         printf("mode before doing anything: %d\n", stlink_current_mode(sl));
 
         if (stlink_current_mode(sl) == STLINK_DEV_DFU_MODE) {
@@ -23,8 +27,8 @@ int main(int ac, char** av) {
 
         printf("-- mode after entering swd mode: %d\n", stlink_current_mode(sl));
 
-        printf("-- chip id: %#x\n", stlink_chip_id(sl));
-        printf("-- core_id: %#x\n", stlink_core_id(sl));
+        printf("-- chip id: %#x\n", sl->chip_id);
+        printf("-- core_id: %#x\n", sl->core_id);
 
         cortex_m3_cpuid_t cpuid;
         stlink_cpu_id(sl, &cpuid);
@@ -39,7 +43,7 @@ int main(int ac, char** av) {
 
         printf("FP_CTRL\n");
         stlink_read_mem32(sl, CM3_REG_FP_CTRL, 4);
-        
+
         // no idea what reg this is..  */
         //     stlink_read_mem32(sl, 0xe000ed90, 4);
         // no idea what register this is...
@@ -54,7 +58,7 @@ int main(int ac, char** av) {
         stlink_write_mem32(sl,0x200000ac, 4);
         stlink_read_mem32(sl, 0x200000a8, 4);
         stlink_read_mem32(sl, 0x200000ac, 4);
-        
+
         /* Test 8 bit write */
         write_uint32(sl->q_buf,0x01234567);
         stlink_write_mem8(sl,0x200001a8,3);
@@ -75,8 +79,8 @@ int main(int ac, char** av) {
         stlink_write_reg(sl, 0x12345678, 15);
         for (off = 0; off < 21; off += 1)
             stlink_read_reg(sl, off, &regs);
-        
-       
+
+
         stlink_read_all_regs(sl, &regs);
 
         printf("-- status\n");