Part Number: CC2652P
Other Parts Discussed in Thread: CC1352P, SYSCONFIG
Tool/software:
Hey all,
I was going over koenkks' amazing zigbee firmware repo, and noticed that he was redefining pin definitions in his preinclude. (This sounds all very specific in details, but it's not relevant I think, but to give you a a sense):
```
# preinclude.h
+// Set default transmit power to 9
+#ifdef CC1352P_2
+ #define TXPOWER 9
+
+ // Different configs, comment for "other" firmware
+ #define LAUNCHPAD_CONFIG 1
+ #ifdef LAUNCHPAD_CONFIG
+ #define CONFIG_RF_24GHZ 0x0000001c
+ #define CONFIG_RF_HIGH_PA 0x0000001d
+ #define SET_CCFG_MODE_CONF_XOSC_CAPARRAY_DELTA 0xc1
+ #else
+ #define CONFIG_RF_24GHZ 0x0000006
+ #define CONFIG_RF_HIGH_PA 0x0000005
+ #define SET_CCFG_MODE_CONF_XOSC_CAPARRAY_DELTA 0xfa
+ #endif
+#endif
```
After some investigation, I found that CONFIG_RF_24GHZ maps to `RF.rfAntennaPin0.$suggestSolution` in `znp.syscfg`. What's worse, I noticed that (also in `znp.syscfg` `Display1.uart.uart.$suggestSolution` would randomly flip between UART0 and UART1 when using the IDE on the syscfg (without me really changing anything) (I understand, it shouldn't matter as long as the pins don't change :p).
Anyway, I'm usually not a fan of keeping 'suggested solutions' and rather prefer to 'hardcode' things so we don't get supprises later. But googling around, I found very little to `$suggestSolution`. Googling gave me even just three result (when searching with double quotes), of which 2 where in chinese, and only one was English, which led me to https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/789784/ccs-codecomposer-conflict-handling-during-porting-to-sysconf that was using ``$assign` (which I isn't very googlable in itself, but in combination with `$suggestSolution` only one page hit, the one just linked) props up.
Compiling with `$suggestSolution` to `$assign` worked, so I hope this now means CCS will for ever honor what is in my znp.syscfg. But I'm confused on their meanings, how would I have done this in the IDE even (I tried a few things, but couldn't get that). And how was I _supposed_ to fix/use this?
To see an example, https://github.com/Koenkk/Z-Stack-firmware/blob/21355f8ab3d1bfaf2f42f895072591fbbc7f447b/coordinator/Z-Stack_3.x.0/znp_CC1352P_2_LAUNCHXL_tirtos7_ticlang.syscfg#L77 is what I did (after re-ordering the file to group relevant bits. The compilation works fine (testing right now if the binary also actually functions)