alejoseb / Modbus-STM32-HAL-FreeRTOS

Modbus TCP and RTU, Master and Slave for STM32 using Cube HAL and FreeRTOS
GNU Lesser General Public License v2.1
539 stars 183 forks source link

Slave Does not allow for memory space larger then 256 #6

Closed ZARichardWright closed 3 years ago

ZARichardWright commented 3 years ago

First off Great Library so far.

I would like to map more the 256 bytes to a modbus slave. I know this is the limit of any one transaction but still would like to have the option to map more. From what i can see the limit is first and for most the fact that u8regsize member of the modbusHandler_t is a uint8_t. I have sort got it working by just increasing this to a 16_t as well as all other locations where the address is cast to a 8_t. My question is am i missing another obvious method of allowing for a larger address space. as i would obviously preferer to try avoid deviating form current master.

Cheers

alejoseb commented 3 years ago

You are right about the transaction size and the memory map, the uint8_t was used in the original Arduino library and I did not change that. I think your approach to extend the memory map is correct, there is no other obvious method.

alejoseb commented 3 years ago

Solved in commit b2e6aa96