-
Notifications
You must be signed in to change notification settings - Fork 26
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
Building firmware for XC90 #1
Comments
hello, in general terms, yes you need to modify the addresses in the CAN handlers, |
This sounds amazing, do we know how his work is progressing? Do we have any link to his work? I would very much like to incorporate this into my XC90... |
I have looked into everything, my year is same year as your code so I think I can flash directly and it will work. I have ST-Link V2 and spare OD-Volvo-02 canbus box. Is there an easy set of instructions of how I can flash? Preferably on Windows? Thanks |
Hello, this is a new link to an image with programs for updating the firmware |
After becoming root user (sudo su) and installing openocd (apt-get install openocd) I got it to run but I'm getting an error (unable to connect to the target) Any ideas? Screenshot: https://ibb.co/rc1KN9m EDIT: It looks like that error is because I have to catch it immediately when connected or it doesn't connect. So I connect 3v pin and immediately run make flash and it runs but this time with a different error: UNEXPECTED idcode: 0x2ba01477 Screenshot: https://ibb.co/ySjwfps |
Ok I got it to flash What I did was I searched for stm32f1x.cfg and found this file 3 times, I changed "0x1ba01477" to "0x2ba01477" in all 3 of these files The flash looks to have completed successfully However I still have the error that I cannot read from serial output properly, my serial output even at 38400 is just scrambled Screenshot: https://ibb.co/hRNYLTJ I hope you can help... |
Wait I got it! I had to copy and paste "OOOOOOOOOOOOO" to get the code in quick enough, I have successfully changed it to XC90 I found though that the configuration page flashes on and off and only stays on screen for a set amount of time so configuration changes have to be made quickly. Next I will test in the car, fingers crossed |
Initial test in car is it is working! Unfortunately though it's not working perfectly Door open messages - Work perfect I guess all of this can be fixed in the configuration before flashing the compiled firmware to my canbus box but I am new to this so it may not be easy for me to work out lol EDIT: canbox.c Would changing:
to:
Fix the reverse trajectory turning the wrong way with the steering? |
Ok so it turns out the trajectory problem can be fixed simply in the software so that's not an issue :-D The biggest problem is canbus buttons. Volume buttons no longer work. Also would be nice if I can get phone buttons working. Can you please help try to fix this... |
It is a shame for the lack of support on this because this would be a great solution for XC90 but unfortunately all functions do not work. For anyone else looking at this for XC90 this is what I have found: Door open messages - Work perfect To fix steering wheel buttons and have brightness dim I will have to use another canbus box unfortunately |
Hello, unfortunately I cannot help you with xc90 support, because I am not the owner of xc90. My friend has an xc90 and all the functionality of the adapter works correctly on his xc90. |
I understand this but what doesn't make sense is buttons on steering wheel. Skip track works but volume doesn't. These are both on the same module and same coding should be used to access them so if skip tracks is working volume should work too unless there is some error in coding for this firmware.... I don't see another explanation Brightness/dimming, I now have this working, for some reason on bench testing the changes I made to adapt brightness trigger setting did not save and I did not realise this, when connecting to car and changing settings I set it to I think 94 and now it works perfectly 😁 So again because all other functions work buttons must be your firmware issue. Maybe it is simply a typo in your code? I don't understand your code enough to work it out. Also because there is phone buttons in theory you should be able to make these work too as these are all on same module so same can address. I have seen somewhere a list of available buttons can messages, I will see if I can find them for you to look at, maybe with this information you may see something that I am unable to understand which may help get a fix..... |
The handling of the volume buttons on the xc90 is now commented out, so they don't work. |
Thank you, yes I thought it must be something simple :-D I have found the information I was looking for, with it do you think you could add extra buttons for XC90? This is the page: As you can see all buttons send basically the same message just very small difference, I don't know how your coding works but I really hope with this you can add them? There is also more info in other pages like: Really I hope you can look at the steering controls and add more.... |
I have read your code many times, I understand if I wanted to add a new button I would have to add to canbox.c, canbox.h, car.c, main.c and xc90_2007my.c What I don't understand is what exactly I would need to add to canbox.c using example a new button called "NEWBUTTON"
Also in xc90_2007my.c
The main buttons I want to add are enter and exit buttons from the link I posted previously, can you please help and point me in the right direction? |
Soon i will pull request with changes adding the accept and reject call buttons, as well as the RTI (navigation) buttons. Just lacking some info about the RTI buttons and which message could i send to the radio so i can navigate. |
This is excellent news, if there is anything I can do to help please let me know... |
You can find under my fork the added buttons(allready on the compiled bin), also i added temp function, but for the moment i dont have access to the car so i cannot test it. i have checked on my bench and everyhting seems correct. The only thing that wont work is the temp as i set it to an older xc90 ccm canbus address. When i have access to my xc90 i will add the address for 2007-onwards canbus address. The buttons should reject and accept calls, and the enter and back from rti should be mute and mic activation. As stated, havent tried yet, but it should work. |
Firstly just wanted to say thank you so much for looking into and helping with this! I have now done some testing with what you have done and I'm here to share my findings New enter and back buttons work perfectly, exactly as intended :-D Answer and reject buttons still unfortunately don't seem to be working The changes you made in main.c seem to stop the auto day/night switching of the backlight brightness. The added line: I don't however understand the code so not sure what these changes are suppose to do? As for buttons extremely pleased and we are on the right track, I can see you have also added the direction buttons, I don't have an app that can remap canbus buttons at the moment but I guess these could be mapped to something? Look forward to hearing from you |
Glad it sort of worked, hehe. I changed that in the past so I can force the night mode if the near lights are on. This does not have to reach final version. The only problem we have is that we are bound to what is developed by the Chinese manufacturers, if they don't add more functions to their canbus app, we are F*****!!!. I wanted to navigate the screen with the direction buttons, but as the golf does not have buttons for that. I'm afraid well never have that unless we can find another car and the Chinese serial protocol (highly unlikely ) and implement another canbox protocol. I have searched on Russian forums and on baidu for more information but could not find any new info. And mapping to any app is a general no, maybe we could map navigation, if the canbus app calls the standard navigation app that is set on settings of the headunit it should work, other apps or remaping, not possible. Id like to get answer and reject working, and maybe ill test what other buttons stated in the MctCoreServices do in the head unit. |
Interesting, I wonder why they made the phone buttons different in this way, doesn't make it easy to reverse engineer lol Also interesting that you found a need to force the change of the brightness because I find it switches to night mode too soon before it gets dark enough, I do wonder if the brightness info from the car differs as mine is an early 2007 model and doesn't have auto headlights from factory, when connecting canbus over putty it seems to just between numbers 94 to 100 for example with nothing in between, oddly the brightness adjustment for dials in the car also affects this so I find it it changes to night mode too soon I can lower dial brightness slightly and screen goes back to day mode. How do you find this? I'm not too worried about extra keys if it cannot be done, I like the idea of a mute button and a voice button I think that was a good idea, just need a way to cancel voice easy and get it to use the phone app now lol A/c info would be very cool Happy to test anything as you get it working or make changes, please keep me updated, also happy to be contacted directly if it's easier via FB messenger or preferably WhatsApp. Thanks again! |
As stated by the creator on another issue, 0x2f will not work. He has shared a de compilation of the canbus.apk from his head unit and there is only a few possible key codes. I'll probably assing each code on the decompilation to a key and test what it does. |
Knowing how these units are made in China I would prob think it is handled very similarly across multiple units, the Chinese head units software they like to do as little work as possible lol, I have faith in you 😁 |
Ok, i edited the code to check what do some of the codes do, i added an excel to the repo with the codes and what to expect.
Id like you to fill the observed action for each empty one. Also does the mic action work correctly, what does it do. |
Thanks again, I will try this asap, prob be tomorrow, as for microphone when pressed it opens up the selected microphone app so for example mine opens up google so I can give voice commands to google Will update you as soon as I can EDIT: Although looking at your repo I can't see any changes have been made, did you push to your repo? |
Forgot to commit, commited and pushed. |
No problem lol, I'll update you as soon as I can |
I have just tested and for me it seems that there is no change at all, nav up down left and right do nothing, phone buttons still do nothing and all other buttons work as before Did everything commit properly or maybe something is missing? |
i could be missing something, or mb those only work under certain conditions, while in a call or if there is an incoming call. the call buttons codes where already on the owners code, just wanted to check were they for. |
Sorry, difficult week at work, i suspect mb i didnt map correctly the pickup/hangup buttons on can level, i have pushed a version where they should trigger mute and mic(speech). If those work, pls tell me and they should be mapped to cont and mode, wich were already there by the original dev. i suspect that those only work if the phone is connected via bluetooth, and there is an incoming/ongoing call. Please test it. |
Also i have found that d-pad action is there for a lexus, i wonder why these chinese did not make a more streamlined code. |
This is the code for raise keys for pq version they are in dec, must be sent as hex.
|
Sorry for the delay, finally did some testing today and there is some progress Volume up does volume up and "ok Google" too Looks like instead of being mapped to hang up button somehow it got mapped to volume up as well as original volume up action lol The 4 dpad nav buttons do nothing I hope this helps and I'm ready to test anything else, I can do testing tonight or tomorrow during the day Thanks again this is so much progress! |
So there is something wrong certainly, ill check when i have time. |
It can't be too bad because you are so close, you have got the call button functioning which didn't work before and 2 other buttons that previously didn't work so you are very close, I'm really excited to see where this leads, getting other stuff on the screen would be so cool, if I can help more please get in touch and I'll do what I can, I'd like to sniff off the canbus myself on my 90 but I failed miserably last time I tried, would love to find codes for some other features in the car and add them like turning child locks on/off, disabling reverse sensors using button, headlight turning, heating, heated seats etc etc haha Look forward to your progress xD |
I mapped it wrong, now it should work ( fingers crossed) . enter(pickup) -> speech (ok google) , exit(hangup) -> mute. |
Regarding this, that would involve writting on the canbus if i got you right. That is riskier thant just listening. Showing heating or heated seats would be possible, but triggering it not so possible with my skill set jejeje. The thing is that you can trigger an SRS (airbag) light if you send something you shouldnt, and that can get expensive if you have to go to the dealer, or buy a DICE/VICE adapter and Software. Also for some things like heated seats i would need you to sniff some can bus codes as i dont have them fitted. I wont be at the end really using enter and exit as i planned, i retrofitted the buttons as well as the rti buttons but they do nothing. So i need you to try it.
|
Haha, thought it might be an easy mistake, we all do it lol I will try this shortly and give you an update within the next hour or so As for sniffing, like I said before I failed miserably but happy to try again with your guidance, as for errors I'm really not worried as long as it's something that can be rectified as I have full Vida/Vdash and dice to clear codes etc so not too worried about that, just getting the info up on screen would be a major leap ahead though, 1 of the things I would like to see is being about to turn on/off parking sensors, I believe someone has already done it for XC90 on a custom based canbus so there may be some helpful code there... |
As expected all working! Just need to map them to the correct keys now 🤣 Thank you! |
Ok, will try this evening if i have time after work. I will map them to what i think is accept and reject (reverse engineering points to them also , says something about bluetooth). Also temp should be working, and mb ac fan speed? |
I look forward to trying As for temp I can't be 100% sure because I've now swapped to a custom firmware on my unit to fix another issue but I think it's still not working. What do you mean for "mb ac fan speed"? Also noticed turning off parking sensors using the button now disabled them on screen too which makes sense but never use to be the case. I think this may be the custom firmware though maybe and not the canbus box... |
Temp is working on my car, i meant "maybe air conditioner air speed is also working", when moving the fan speed dial it should show on screen the ac menu but for me it is not. |
I could test it, in lunch break, temp is working, but temperature is not correct showing 10C should be 18-19C, the aircon speed is working sort of, only the first 3 speeds show, will have to check the conversion for both states. |
Updated code, ac speed should be fixed, also the air recycling button, the temp should be correct , the function is all over the internet x*0.75-48 maybe my temp sensor is broken? Please test with raise vw pq in can bus settings, with oudi xc90 only the basics work, no ac option. |
Tested already and for me it seems very close! Fan speed 4/5/6/7 all working correctly. Fan speed below that all show as 1 less than should be. So speed 3 shows 2 on screen, 2 shows 1 on screen and 1 shows off, off doesn't show anything, switching from off to 1 does nothing, display shows up when I change to speed 2 and it shows speed 1 on screen. Recirculation button doesn't sound anything for me. Temperature is working but I think the temperature is wrong, it's showing 14C but my car under time was showing 18C but now shows 20C yet car still shows 14C Phone buttons now not working at all as expected. Hopefully this is helpful haha Good work! |
Something else I noticed today, outside temp went up today to about 21C but car still reported 14C, maybe the info is being pulled from the wrong place and that's why temp is wrong? As it's not updated when outside temp has changed by a fair amount... |
It is the climate module sensor, it is inside the car, i dont know why it reads a few degrees below. |
Ah, in that case maybe it is reading correctly, I will try to borrow a thermometer that works in the car to try to compare temps and see if it is accurate I will try this new version tomorrow I would think these messages would be present in can to be able to send signals to various parts of the car although I suppose it is possible that these messages may only be sent over the linbus? I am not too familiar with how it works in this car but I hope you can find it and make the display for heating fully functional. Heated seats should be in canbus so hopefully we can find them at some point too :-D Have you had any more luck yet with phone buttons? These are quite important for me so my fingers are crossed I did also find some information when doing some searches which may help in adding some other canbus stuff? I know there is a "car app" on the head unit which should show some things but most do not work so possibly could be added, on this link: is possible information to add parking brake, wiper fluid level to this app, dont know if seatbelt is helpful? And this information maybe helpful for speed and rpm: 0x12177FC 01 02 40 00 10 40 3A B8 //speed: B6 b0-b1 – B7 b0-b7, divide by 4, 174km/h 0x2A07428 0B 0D C4 0E 0F FD 2F 17 //revs: B6 b0-b3 - B7 b0-b7, 3863 per minute I can't say for sure if this information will be correct but I hope it helps |
Supposedly there are multiple lin bus networks, and this attach to a "master" ECU and is the master ECU the one that sends the can data to the can bus. This is something that happens for example with SWC. As i said , if the data is there, and the radio expects it we can code it. My car does not "have" those buttons, it does physically (it didn't in the past), but it does not for the ECU, that is why i think they do not work (i wish they did haha), the main problem is that we do not know what to expect from the android hu when we send 0x09 or 0x0a. it should work i don't know why it doesn't.
Where did you get those can bus codes? i cannot find those addresses on my sniffing's. |
I am happy to try sniffing if it will help, I don't know how but could do it with guidance Wiper fluid yes car knows as it comes up when it's empty I just googled, I can't remember exactly where now I found them I tested today anyway and most levels now work on heating but level 3 doesn't work at all and level 2 can be hit or miss when coming back down levels but it's much better. Still no other buttons do anything for heating. For answer/hangup buttons you were able to successfully make them do other functions so I assume reading the data from the car is fine it's only sending the correct data to the car now for answer/hangup and I think this will be the same for all cars so maybe look into what is sent for other vehicles to make this work? Heating system is an odd one and it may be that this cannot be fully implemented which would be a shame but I also never expected it so any work you do is much appreciated |
I have got the phone buttons working! canbox.c This works, when not in call it opens phone/bluetooth app, when in call it hangs up, when someone is calling it answers the phone So simply set this to both buttons, I think maybe the head unit or canbus box is not setup to have separate answer/hangup buttons? Also I found: This operates the Change Mode/Players Quick Button on the unit. I temporarily set this to all sat nav direction buttons I haven't found anything else yet, maybe that's all? |
It makes sort of sense, im happy for you as you wanted the telf so much. Also i dont understand what 0x07 does. For the record, those CAN addresses are from the HS can bus. not available from the connectors the Chinese sell, as those tap into the LS radio cables. |
I am not familiar with the canbus or how it is interfaced so I can't really help much more at this point without help and guidance 0x07 - On my head unit there is what's called a "Mode" button. This button basically is used to switch between certain apps. I can choose apps I want in a list so for example Maps/Music/Radio, when I press button it shows icons for these 1 at a time and changes each button press, I just press button until for example "Maps" is shown on screen and wait and it brings up maps Hope this helps and look forward to your next findings P.s I have sent you an email |
Prev and next buttons are wrong way round so in canbox.c I changed 0x04 to 0x03 on lines 459 and 471 and 0x03 to 0x04 on lines 451 and 479 Front left and right door are the wrong way round, this can be fixed in xc90_2007my.c on line 90/91 with this: Reverse trajectory also moves the wrong way as your aware, I know this can be fixed but I don't understand the scale method it uses to know the fix but I would guess the fix is in line 13 of xc90_2007my.c somewhere with this: I wouldn't know what to change though, I could experiment but I don't have the time right now (EDIT: I have done some testing with no results) Then optionally because most XC90 does not have front parking sensors I decided to remove them but this is optional, I didn't want them to be on the display so I removed all lines from xc90_2007my.c and canbox.c relating to front sensors |
Haven't heard from you in a while, I hope all is well and very interested to see if you have made any progress 😁 |
Hi, everything is ok, just very busy at work. As soon as I make any progress I'll update. |
No need to change the code, those can be easilly be adjusted in the settings of the HU, both the trajectory and the prev and next buttons, as well as the information of the opened doors. |
I am new to this so I apologize in advance
I would like to build the firmware for a volvo_od2 for use in an XC90
I assume to function I only need to update addresses of my modules at the end of canbox/cars/xc90_2007my.c?
What confuses me the most is how do I find all the addresses of my modules to be able to do this?
I really hope you can...
Edit: Also link to Virtual machine (https://drive.google.com/file/d/1XCHW03gKX6WUB6tFS7kKD0kZkctj8inW/view?usp=sharing) is down I cannot download...
The text was updated successfully, but these errors were encountered: