whitequark[cis] changed the topic of #glasgow to: https://glasgow-embedded.org · digital interface explorer · https://www.crowdsupply.com/1bitsquared/glasgow · code https://github.com/GlasgowEmbedded/glasgow · logs https://libera.irclog.whitequark.org/glasgow · matrix #glasgow-interface-explorer:matrix.org · discord https://1bitsquared.com/pages/chat
redstarcomrade has joined #glasgow
redstarcomrade has quit [Changing host]
redstarcomrade has joined #glasgow
skipwich has quit [Quit: DISCONNECT]
skipwich has joined #glasgow
vipqualitypost[m has quit [Quit: Idle timeout reached: 172800s]
smeding has quit [Quit: Lost terminal]
SophiaNya has quit [Remote host closed the connection]
SophiaNya has joined #glasgow
_alice has quit [*.net *.split]
ar-jan has quit [*.net *.split]
mwk has quit [*.net *.split]
sam_w has quit [*.net *.split]
jdek has quit [*.net *.split]
yuriks has quit [*.net *.split]
davidc__ has quit [*.net *.split]
sknebel has quit [*.net *.split]
as_g5pw has quit [*.net *.split]
Griwes has quit [*.net *.split]
ar-jan has joined #glasgow
sam_w has joined #glasgow
_alice has joined #glasgow
mwk has joined #glasgow
jdek has joined #glasgow
yuriks has joined #glasgow
davidc__ has joined #glasgow
as_g5pw has joined #glasgow
sknebel has joined #glasgow
Griwes has joined #glasgow
radii has quit [*.net *.split]
elms has quit [*.net *.split]
mal has quit [*.net *.split]
ari has quit [*.net *.split]
ebb has quit [*.net *.split]
Jonimus has quit [*.net *.split]
ePirat has quit [*.net *.split]
joj has quit [*.net *.split]
RaYmAn has quit [*.net *.split]
elms has joined #glasgow
radii has joined #glasgow
mal has joined #glasgow
ari has joined #glasgow
ebb has joined #glasgow
Jonimus has joined #glasgow
ePirat has joined #glasgow
joj has joined #glasgow
RaYmAn has joined #glasgow
redstarcomrade has quit [Read error: Connection reset by peer]
cr1901_ has joined #glasgow
cr1901 has quit [Ping timeout: 276 seconds]
bvernoux has joined #glasgow
pie_ has joined #glasgow
smeding has joined #glasgow
cr1901_ is now known as cr1901
smeding has quit [Quit: leaving]
Eli2| has joined #glasgow
Eli2_ has quit [Ping timeout: 260 seconds]
<_whitenotifier-3> [glasgow] purdeaandrei opened pull request #656: firmware: remove unnecessary check (+25 bytes XRAM). - https://github.com/GlasgowEmbedded/glasgow/pull/656
<_whitenotifier-3> [glasgow] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-656-deb776cd9e98124dc97e43d3d24e245fb3537404 - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-3> [glasgow] whitequark commented on pull request #656: firmware: remove unnecessary check (+25 bytes XRAM). - https://github.com/GlasgowEmbedded/glasgow/pull/656#issuecomment-2265878334
<_whitenotifier-3> [GlasgowEmbedded/glasgow] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±1] https://github.com/GlasgowEmbedded/glasgow/compare/deb776cd9e98...794d280dff49
<_whitenotifier-3> [GlasgowEmbedded/glasgow] purdeaandrei 794d280 - firmware: remove unnecessary check (+25 bytes XRAM).
<_whitenotifier-3> [glasgow] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-656-deb776cd9e98124dc97e43d3d24e245fb3537404 - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-3> [glasgow] whitequark closed pull request #656: firmware: remove unnecessary check (+25 bytes XRAM). - https://github.com/GlasgowEmbedded/glasgow/pull/656
cr1901 has quit [Ping timeout: 260 seconds]
<purdeaandrei[m]> whitequark (@_discord_182174208896401419:catircservices.org) what do you think about adding a generic i2c access feature to the protocol? I think a lot code could be moved out of firmware and into python.
<purdeaandrei[m]> I know it's discouraged to write independent software that directly talks to the firmware. This change would make it even harder to write such software. But it would open up a lot of space for features that _need_ to be in the firmware, and other new features would not need a firmware update, for example reading current, and setting up current limits, as it is right now it would require extra code in firmware
<whitequark[m]> I don't think the software should know anything about I2C or stuff
<whitequark[m]> I'm fine with it requiring extra code in firmware
<whitequark[m]> it's quite deliberate that there's no generic I2C access, it's kind of a real pain in the ass to program firmware that requires this and I strongly dislike it as an engineering practice
<whitequark[m]> regarding code size concerns, if the control request processing code would be moved to have a single command "control in / control out" request/response style protocol with something closer to how you write TCP based protocols as the application logic, I think that would free up a lot of code space
<whitequark[m]> I'm also, frankly, not in a place regarding my health that lets me think about and review such big changes in depth
<whitequark[m]> s/regarding/with/
<whitequark[m]> to expand on this, I would eventually like to move to a pure stream-based protocol for everything that's happening with the device, so that both control and data plane could be encapsulated in TCP, be network-transparent, and so on
<whitequark[m]> while this does not inherently preclude packing I2C accesses into a stream-based protocol like this, it makes it a much more closely coupled system to manage, and indeed creates issues for non-glasgow software trying to configure a device
<whitequark[m]> and in doing so, it counteracts the biggest benefit of moving to a stream-based protocol, which is that it's easier to program
<whitequark[m]> over time, people have suggested similar changes to the firmware (like shipping three different firmwares, per device version) and I feel like that's just admitting a failure of engineering. we tolerate this in commercial products where cost of development is a major concern, but Glasgow isn't really a commercial product
<whitequark[m]> in that much of the development isn't driven by market forces
icb_ has joined #glasgow
icb has quit [Ping timeout: 244 seconds]
dustinm` has quit [Quit: Leaving]
Jarrett[m] has joined #glasgow
<Jarrett[m]> "cool"-based product development is the best thing imo
dustinm` has joined #glasgow
cr1901 has joined #glasgow
bvernoux has quit [Quit: Leaving]
<purdeaandrei[m]> Thanks, understood. Could you clarify "control in / control out" request/response style protocol would look like? I don't quite understand from just the above description.
<whitequark[m]> oh, another approach I've been thinking about to reduce code size is to write a simple state machine for I2C access
<whitequark[m]> basically do something like uint8_t cmds[] = {I2C_START, ADDR, I2C_WRITE_IMM, 2, 0x00, 0x00, I2C_START, I2C_READ, 8, I2C_STOP}; uint16_t* data[] = {EP0BUF}; i2c_perform(cmds, data);
<whitequark[m]> and only have one big switch somewhere in i2c.c or whatever that would handle all of the register access
<whitequark[m]> it's kind of like I2C bytecode
<whitequark[m]> re: control in/control out style protocol, do you know how a normal type-length-value based protocol is designed?
<whitequark[m]> you send a packet that says "type: read data, length-in: 2, address: 0x00, 0x00" and then wait for a reply of length 2
<whitequark[m]> we could have exactly two control requests, SEND and RECV, where anything stuffed into SEND is parsed according to a header, and then where you need a reply, you send a RECV after and it's filled in by the device
<whitequark[m]> this does mean there is state carried across two distinct control requests, but the flipside is that there is less code involved in validating them, and that it maps much better on something like TCP
<purdeaandrei[m]> I'll think about those, thanks
<_whitenotifier-3> [glasgow] purdeaandrei opened pull request #657: firmware: move factored-out ep0 stall to end of fn (+13 bytes XRAM). - https://github.com/GlasgowEmbedded/glasgow/pull/657
<_whitenotifier-3> [glasgow] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-657-794d280dff49b53960ca122dc2254ecce1679226 - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-3> [GlasgowEmbedded/glasgow] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±1] https://github.com/GlasgowEmbedded/glasgow/compare/794d280dff49...f7789dee2afd
<_whitenotifier-3> [glasgow] whitequark closed pull request #657: firmware: move factored-out ep0 stall to end of fn (+13 bytes XRAM). - https://github.com/GlasgowEmbedded/glasgow/pull/657
<_whitenotifier-3> [glasgow] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-657-794d280dff49b53960ca122dc2254ecce1679226 - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-3> [glasgow] purdeaandrei opened pull request #658: firmware: factor out superset bmRequestType check (+116 bytes XRAM). - https://github.com/GlasgowEmbedded/glasgow/pull/658
<_whitenotifier-3> [glasgow] purdeaandrei opened pull request #659: Firmware factor out checking of direction - https://github.com/GlasgowEmbedded/glasgow/pull/659
<_whitenotifier-3> [glasgow] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-658-f7789dee2afdcdd988a3b891d592e0e0c89cf88e - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-3> [GlasgowEmbedded/glasgow] github-merge-queue[bot] pushed 1 commit to main [+0/-0/±1] https://github.com/GlasgowEmbedded/glasgow/compare/f7789dee2afd...57611d52a5be
<_whitenotifier-3> [GlasgowEmbedded/glasgow] purdeaandrei 57611d5 - firmware: factor out superset bmRequestType check (+116 bytes XRAM).
<_whitenotifier-3> [glasgow] whitequark closed pull request #658: firmware: factor out superset bmRequestType check (+116 bytes XRAM). - https://github.com/GlasgowEmbedded/glasgow/pull/658
<_whitenotifier-3> [glasgow] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-658-f7789dee2afdcdd988a3b891d592e0e0c89cf88e - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-3> [glasgow] purdeaandrei synchronize pull request #659: Firmware factor out checking of direction - https://github.com/GlasgowEmbedded/glasgow/pull/659
<_whitenotifier-3> [glasgow] purdeaandrei commented on pull request #659: Firmware factor out checking of direction - https://github.com/GlasgowEmbedded/glasgow/pull/659#issuecomment-2266252331
<_whitenotifier-3> [glasgow] purdeaandrei commented on pull request #659: Firmware factor out checking of direction - https://github.com/GlasgowEmbedded/glasgow/pull/659#issuecomment-2266252992
<_whitenotifier-3> [glasgow] whitequark reviewed pull request #659 commit - https://github.com/GlasgowEmbedded/glasgow/pull/659#discussion_r1702396334
<_whitenotifier-3> [glasgow] purdeaandrei synchronize pull request #659: Firmware factor out checking of direction - https://github.com/GlasgowEmbedded/glasgow/pull/659
<_whitenotifier-3> [glasgow] purdeaandrei reviewed pull request #659 commit - https://github.com/GlasgowEmbedded/glasgow/pull/659#discussion_r1702398961
<_whitenotifier-3> [glasgow] github-merge-queue[bot] created branch gh-readonly-queue/main/pr-659-57611d52a5be75ad0c585a651b0da681c942ff55 - https://github.com/GlasgowEmbedded/glasgow
<_whitenotifier-3> [GlasgowEmbedded/glasgow] github-merge-queue[bot] pushed 2 commits to main [+0/-0/±2] https://github.com/GlasgowEmbedded/glasgow/compare/57611d52a5be...44923e01a193
<_whitenotifier-3> [GlasgowEmbedded/glasgow] purdeaandrei 9eb7850 - firmware: factor out checking if it's a read (+35 bytes XRAM).
<_whitenotifier-3> [GlasgowEmbedded/glasgow] purdeaandrei 44923e0 - firmware: add register keyword to optimize code size (+19 bytes XRAM).
<_whitenotifier-3> [glasgow] whitequark closed pull request #659: Firmware factor out checking of direction - https://github.com/GlasgowEmbedded/glasgow/pull/659
<_whitenotifier-3> [glasgow] github-merge-queue[bot] deleted branch gh-readonly-queue/main/pr-659-57611d52a5be75ad0c585a651b0da681c942ff55 - https://github.com/GlasgowEmbedded/glasgow