mirror of
				https://github.com/esp8266/Arduino.git
				synced 2025-10-31 15:50:55 +03:00 
			
		
		
		
	## WPA2 Enterprise connections
References - merged PRs:
* https://github.com/esp8266/Arduino/pull/8529
* https://github.com/esp8266/Arduino/pull/8566 - these occurred with connect/disconnect with WPA-Enterprise
* https://github.com/esp8266/Arduino/pull/8736#issue-1470774550
The NON-OS SDK 3.0.x has breaking changes to the [`pvPortMalloc`](bf890b22e5/include/mem.h (L42)) function. They added a new `bool` argument for selecting a heap. 
```cpp
void *pvPortMalloc (size_t sz, const char *, unsigned, bool);
```
To avoid breaking the build, I added a new thin wrapper function `sdk3_pvPortMalloc` to `heap.cpp`. 
Edited new SDK LIBs to call `pvPortMalloc`'s replacement `sdk3_pvPortMalloc`.
They also added `pvPortZallocIram` and `pvPortCallocIram`, which are not a problem to support. Support added to `heap.cpp`.
Issues with WPA2 Enterprise in new SDKs:
* v3.0.0 and v3.0.1 - have the same memory leak and duplicate free bugs from before
* v3.0.2 through v3.0.5 - have the same memory leak; however, _no_ duplicate free crash.
* memory leak can be seen by cycling through setup, connect, disconnect, and clear setup - repeatedly.
Updated `wpa2_eap_patch.cpp` and binary patch scripts to handle v3.0.0 through v3.0.5.
Patched SDKs v3.0.0 through v3.0.5
## Duplicate Non-32-bit exception handler
Issue: At v3.0.0 and above `libmain.a` supplies a built-in exception handler (`load_non_32_wide_handler`) for non-32-bit access. Our non-32-bit access handler (`non32xfer_exception_handler`) overrides it. 
Solution: Add "weak" attribute to symbol `load_non_32_wide_handler`. Adjust the build to default to the SDK's built-in non-32-bit handler.  If there is a need to use our non-32-bit handler, make the selection from the Arduino IDE Tools menu `Non-32-Bit Access: "Byte/Word access to IRAM/PROGMEM (very slow)"`.
With SDKs v3.0.0 and above a "non-32-bit exception handler" is always present.
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| ## Adding a new SDK library
 | |
| 
 | |
| - Create a directory for the new SDK.
 | |
| - Copy .a files from SDK `lib` directory to the new directory
 | |
| - Add the new SDK directory to those supported in `eval_fix_sdks.sh` and `fix_sdk_libs.sh`.
 | |
| - To support WPA2 Enterprise connections, some patches are  reguired review `wpa2_eap_patch.cpp` and `eval_fix_sdks.sh` for details.
 | |
| - Use `./eval_fix_sdks.sh --analyze` to aid in finding relevant differences.
 | |
|   - Also, you can compare two SDKs with something like `./eval_fix_sdks.sh --analyze "NONOSDK305\nNONOSDK306"`
 | |
| - Apply updates to `fix_sdk_libs.sh` and `wpa2_eap_patch.cpp`. You can run `./eval_fix_sdks.sh --patch` to do a batch run of `fix_sdk_libs.sh` against each SDK.
 | |
| - If you used this section, you can skip _Updating SDK libraries_.
 | |
| 
 | |
| ## Updating SDK libraries
 | |
| 
 | |
| - Copy .a files from SDK `lib` directory to this directory
 | |
| - Run `fix_sdk_libs.sh`
 | |
| 
 | |
| 
 | |
| ## Updating libstdc++
 | |
| 
 | |
| After building gcc using crosstool-NG, get compiled libstdc++ and remove some objects:
 | |
| 
 | |
| ```bash
 | |
| xtensa-lx106-elf-ar d libstdc++.a pure.o
 | |
| xtensa-lx106-elf-ar d libstdc++.a vterminate.o
 | |
| xtensa-lx106-elf-ar d libstdc++.a guard.o
 | |
| xtensa-lx106-elf-ar d libstdc++.a functexcept.o
 | |
| xtensa-lx106-elf-ar d libstdc++.a del_op.o
 | |
| xtensa-lx106-elf-ar d libstdc++.a del_opv.o
 | |
| xtensa-lx106-elf-ar d libstdc++.a new_op.o
 | |
| xtensa-lx106-elf-ar d libstdc++.a new_opv.o
 | |
| ```
 |