Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pr 16bit addressing support #33

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

viorz
Copy link

@viorz viorz commented May 18, 2023

TMS320 have 16-bits addressing, so

  1. (uint8_t) same (uint16_t)
  2. sizeof(float) is 2
  3. union not same like STM32, because type uint8_t does not exist in hardware

Example:
union
{
uint64_t u8;
uint64_t u16;
uint64_t u32;
uint64_t u64;
uint8_t bytes[8];
} storage;

 address:|   bytes:        |   u64:                      |   u32:                       |   u16:    |   u8:
 0x00      |   bytes[0]    |   (u64         )&0xFF  |   (u32         )&0xFF  |   u16     |   u8
 0x01      |   bytes[1]    |   (u64>>16)&0xFF  |   (u32>>16)&0xFF  |
 0x02      |   bytes[2]    |   (u64>>32)&0xFF  |
 0x03      |   bytes[3]    |   (u64>>48)&0xFF  |
 0x04      |   bytes[4]    |
 0x05      |   bytes[5]    |
 0x06      |   bytes[6]    |
 0x07      |   bytes[7]    |

@tridge tridge force-pushed the pr-16bit_addressing-support branch 2 times, most recently from 33bf5f2 to de0307f Compare June 4, 2023 08:39
@tridge
Copy link
Member

tridge commented Jun 4, 2023

@viorz thanks for the contribution!
what testing have you done on this?

@tridge tridge force-pushed the pr-16bit_addressing-support branch from de0307f to 790a5db Compare June 4, 2023 21:33
@tridge
Copy link
Member

tridge commented Jun 4, 2023

I've pushed some fixes to try to get CI to pass

@tridge tridge force-pushed the pr-16bit_addressing-support branch 2 times, most recently from f7a4eba to 71aa143 Compare June 4, 2023 22:07
@tridge
Copy link
Member

tridge commented Jun 4, 2023

@viorz it now builds and passes tests, but please let me know what testing you have done so I can be sure it really works

@tridge tridge force-pushed the pr-16bit_addressing-support branch 3 times, most recently from 4465fad to 8a7115e Compare June 9, 2023 21:29
@tridge tridge force-pushed the pr-16bit_addressing-support branch from 8a7115e to c936501 Compare July 17, 2023 03:36
@tridge
Copy link
Member

tridge commented Jul 17, 2023

@viorz any update?

@EMBRMP2
Copy link

EMBRMP2 commented Aug 28, 2023

@viorz have you tested this commit with any TMS320 microcontroller

@tridge tridge force-pushed the pr-16bit_addressing-support branch from c936501 to ea062f4 Compare August 31, 2023 01:12
@tridge
Copy link
Member

tridge commented Nov 15, 2023

I believe this will work, and will merge, hopefully someone with this type of MCU will test

@tridge tridge merged commit 9615d12 into dronecan:master Nov 15, 2023
2 checks passed
@viorz
Copy link
Author

viorz commented Nov 28, 2023

I tested it on TMS320F280049 and it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants